Adding maps, currency, agriculture or image processing to a project usually means signing up with a separate provider for each, juggling several keys and reading several sets of docs. With APIKodu, it all runs on one account and one API key. This guide gathers what you need to go from your first call to production: authentication, the OpenAPI 3.1 spec, response and error formats, quota headers, and handling HTTP 429 properly.
Your first call
When you open a free account, your API key is created in the dashboard. Every API is called over HTTPS from the same base URL, https://api.apikodu.com, with the key in the x-api-key header:
curl "https://api.apikodu.com/api/v1/exchangerates/convert?amount=100&from=EUR&to=TRY" \
-H "x-api-key: YOUR_API_KEY"Here's the same call in JavaScript, Python and C#:
// JavaScript
const res = await fetch(url, {
headers: { "x-api-key": "YOUR_API_KEY" }
});# Python
import requests
requests.get(url, headers={"x-api-key": "YOUR_API_KEY"})// C#
var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");Don't put your key in browser-side code or a public repository. Calling the APIs from your own server is the safest way to keep it secret.
Keep the key out of your code
Store the key in an environment variable rather than hard-coding it. That way it isn't shared along with your code, and rotating it doesn't mean changing code:
# Python
import os, requests
headers = {"x-api-key": os.environ["APIKODU_API_KEY"]}
requests.get(url, headers=headers)The OpenAPI 3.1 spec
Every API is described in the OpenAPI 3.1 specification, including parameters, sample responses, errors and the credit cost of each call (x-credit-cost). That means you can:
- Import it into tools like Postman or Insomnia and start testing right away.
- Generate a client in your language with any OpenAPI-compatible code generator.
- See what a call costs before you write a line of code.
The same information, in a human-friendly form with code samples, is in the API Catalog.
Response format and quota headers
Successful responses are wrapped as { data: { ... } }; errors come back as { code, message }, where code is a negative integer that identifies the error type.
Successful responses also return headers that help you track usage:
x-api-credits-used: credits used by this call.x-api-remaining-credits: credits left.x-rate-limit-limit,x-rate-limit-remaining,x-rate-limit-reset: the per-minute request limit, requests left, and when the limit resets.
The credit rule is simple: only successful calls use credits, and failed calls are free. There are no overage charges either; when your credits run out, requests are declined.
Handling errors and HTTP 429
These are the cases you'll meet most often in production:
- 400: a parameter is missing or invalid. The
messagetells you what's wrong; fix the request before retrying. - 401 (-100): the key is missing, invalid, inactive, expired, blocked by an IP restriction, or not allowed for this API. Check your key and its settings.
- 429 (-221): the per-minute limit was exceeded. Wait until
x-rate-limit-resetand try again. - 429 (no code): your plan credits don't cover this request. The body may include
{ error, limit, currentUsage, requestCost }. Waiting won't fix it; you'll need the next period or a plan upgrade. - 410 (-380): the API has been disabled or deprecated.
- 500 (-1): an unexpected server error.
Tell the two 429s apart
Both share the same status code, but they need different fixes. For the per-minute limit, waiting is enough; for the credit quota, it isn't. A practical rule: if the body's code is -221, retry with exponential backoff. If there's no code, stop retrying and alert the user or your team. Retry loops slow your app down and hide the real problem.
On top of that, briefly caching results that rarely change, such as the daily TCMB exchange rates, cuts down on unnecessary calls.
FAQ
Can I use every API with the same key?
Yes. All APIs are called with the same key and the same header. A 401 saying the API isn't allowed for the key means a restriction has been applied to that key.
Can I use the same key from AI tools?
Yes. The MCP server works with the same API key, and the credit rules are the same.
Where can I see plans and credit details?
Current plans are on the Pricing page, and common questions in our FAQ. Running into trouble? Contact us.

