API reference
One host, one auth scheme, one error shape - and two surfaces with different jobs.
| Base URL | What it is | Key scope |
|---|---|---|
https://api.tinyhop.eu/v1 | Inference: chat completions and the model list. What your application calls | inference |
https://api.tinyhop.eu/mgmt/v1 | Your account from a script: settings, routing, usage, the balance | manage |
- Chat completions - the OpenAI endpoint, the parameters we read, streaming, and the headers that tell you which provider answered.
- Management API - settings, per-model routing, usage, notices and the account, for your own tooling.
Authentication
A bearer token, on both surfaces:
curl https://api.tinyhop.eu/v1/models -H "Authorization: Bearer $TINYHOP_KEY"
A key belongs to exactly one account and carries exactly one scope, chosen when you create it in the dashboard. It is shown once - we store a hash, not the key. The scope never changes afterwards: a key that needs more is a second key, because a secret that can raise its own rights is a secret nobody can reason about after a leak.
| Scope | Reaches |
|---|---|
inference | /v1 - chat completions, the model list |
manage | /mgmt/v1 - settings, routing, usage, notices, the balance, the export |
An inference key on the management surface (or the other way round) answers 403 insufficient_scope, not 401: the
key is valid and your client should keep it.
Errors
Both surfaces answer with the same envelope:
{
"error": {
"message": "No offer this account can reach sells that model.",
"type": "invalid_request_error",
"code": "model_not_found"
}
}
code is the contract - switch on it. message is a sentence for a person and may change. type is the coarse class
(invalid_request_error, authentication_error, permission_error, api_error).
Every error list in this reference names the status and the code, so a client can tell "top up" from "your key is wrong" without reading English prose.
Rate limits
- Inference has a concurrency cap per account, not a request-per-second budget: you may keep as many requests in
flight as your plan allows, and a request over that cap answers
429 rate_limit_exceededwithRetry-After. A slot frees when a request finishes. - The management surface is limited to 60 requests per minute per account, answered as
429 rate_limitedwithRetry-After. It is a control surface, not a data pump. - Failures with a key are counted per IP address, so guessing keys gets an address closed for a window. A
401or403on a valid request does not count against your own limit.
Money
Amounts are decimal strings, never floats, with up to eight decimal places and no rounding on the way out:
{"currency": "EUR", "balance": "12.34", "reserved": "0.0004", "available": "12.3396"}
balance is what was paid in minus what was spent. reserved is the worst-case sum of the requests in flight. A
request is gated on available, so a client that watches available sees a 402 coming and one that watches
balance does not.
Versioning
The version is in the path: /v1, /mgmt/v1. Additive fields do not need a new version - ignore what you do not
know - and a breaking change gets a new number instead of a silent edit.