Management API
/mgmt/v1 is the same account the dashboard shows, minus the buttons: your settings, the routing of a single model,
the usage, the balance, the inbox. It is meant for your own tooling - a cron job that watches the balance, a deployment
script that pins a model to one provider, a nightly export.
manage key, not an inference keyEverything here needs a key with the manage scope. An inference key answers 403 insufficient_scope - it is valid,
it is just not allowed here, and your client should keep it.
Your first call
- curl
- Python
curl https://api.tinyhop.eu/mgmt/v1/credits \
-H "Authorization: Bearer $TINYHOP_MANAGE_KEY"
import requests
answer = requests.get(
"https://api.tinyhop.eu/mgmt/v1/credits",
headers={"Authorization": f"Bearer {MANAGE_KEY}"},
timeout=10,
).json()
print(answer["available"], answer["currency"])
{"currency": "EUR", "balance": "12.34", "reserved": "0.0004", "available": "12.3396"}
The endpoints
| Method | Path | What it does |
|---|---|---|
GET | /account | Who owns the key, and the balance in one answer |
GET | /credits | Only the three numbers - for a script that should not read your address |
GET | /settings | Routing mode, allowed providers, the quantization switch, requirements |
PATCH | /settings | Change one or more of them |
GET | /providers | The catalogue: slug, name, country, whether it can answer |
GET | /models | Every model you can reach, with every offer behind it |
GET | /models/{model} | One row of that list |
GET | /models/{model}/routing | The per-model exception, and the providers you could pick |
PUT | /models/{model}/routing | Set that exception |
GET | /usage | Requests, tokens, cost and latency per model and provider |
GET | /usage/series | One model, day by day |
GET | /notices | The inbox: what we told you, and what you closed |
POST | /notices/{id}/dismiss | Close one message |
GET | /api-keys | Your keys, without the key material |
GET | /account/export | Everything we hold about the account, as a download |
DELETE | /account | End the account (password required) |
Account and credits
{
"user_id": "01K0…",
"email": "ben@example.eu",
"balance": "12.34",
"reserved": "0.05",
"available": "12.29",
"api_base": "https://api.tinyhop.eu/v1"
}
available is the number a request is gated on: balance minus what the requests in flight reserved. /credits
answers the same three numbers and nothing else, so a monitoring job does not have to be able to read your address.
Settings
{
"mode": "cheapest",
"providers": "all",
"allow_quantized_models": false,
"requirements": []
}
| Field | Accepted | Refused with |
|---|---|---|
mode | cheapest, fastest, balanced | 400 invalid_mode |
providers | "all", or a list of provider slugs | 400 unknown_provider |
allow_quantized_models | bool | 400 invalid_body |
requirements | list from the vocabulary (iso27001) | 400 invalid_body |
providers is "all" or a list - there is no third state. An empty list is refused: send "all" to allow everything
again. That is not pedantry, it is the one shape the storage cannot keep.
allow_quantized_models is opt-in. Off means only full-precision offers compete (fp16, bf16, or a provider that says
it never quantizes); on lets the cheaper fp8 and int4 offers in too.
requirements narrows the catalogue to providers that can prove a property - iso27001 today. What cannot be proven is
excluded, never assumed.
- curl
- Python
# A provider list, and quantized offers allowed
curl -X PATCH https://api.tinyhop.eu/mgmt/v1/settings \
-H "Authorization: Bearer $TINYHOP_MANAGE_KEY" \
-H "Content-Type: application/json" \
-d '{"providers": ["entrim", "arkane"], "allow_quantized_models": true}'
requests.patch(
"https://api.tinyhop.eu/mgmt/v1/settings",
headers={"Authorization": f"Bearer {MANAGE_KEY}"},
json={"mode": "fastest"},
timeout=10,
).raise_for_status()
PATCH, not PUT: a field you do not send keeps its value, and the answer is always the full state as it now stands -
so a script needs no follow-up GET.
Providers
{"data": [
{"slug": "entrim", "name": "Entrim", "country": "SI", "internal": false, "active": true}
]}
country is where the datacenters stand, not where the company is registered. active false means the catalogue knows
the provider but it cannot answer right now - do not expect a request there to work.
Models
GET /mgmt/v1/models answers every model you can reach with every offer behind it - the whole decision, not a
summary. One row:
{
"model": "deepseek-v4-1-flash-1017",
"routing": "Global - Cheapest",
"providers": ["entrim", "arkane"],
"winner": "entrim",
"guaranteed": {"prompt": 655360, "max_output": 131072, "context": 1000000},
"offers": [
{
"provider": "entrim",
"country": "SI",
"context_window": 1000000,
"max_output_tokens": 131072,
"tool_calling": true,
"image_input": true,
"reasoning": true,
"in_price": "0.20",
"out_price": "0.60",
"cached_in_price": "0.005",
"quantization": "fp8",
"ema_latency_ms": 412,
"winner": true
}
]
}
| Field | Meaning |
|---|---|
routing | What follows for this model right now, in the dashboard's words: Global - Cheapest, Static - Entrim - Failover |
providers | The slugs that can serve it, in ranking order |
winner | The provider a request would reach first |
guaranteed | {prompt, max_output, context} - what every offer holds at once, the numbers an agent may assume |
offers[].in_price, out_price | Euro per million tokens, input and output |
offers[].cached_in_price | Euro per million cached prompt tokens; absent means the input price |
offers[].ema_latency_ms | Measured time to first byte; absent until something was measured |
offers[].quantization | What runs there: fp8, nvfp4, fp16, … |
GET /mgmt/v1/models/{model} answers a single row, which is what a script should use instead of reading the whole list.
Per-model routing
One model can deviate from the account's mode, and static pins it to a single provider.
{
"model": "deepseek-v4-1-flash-1017",
"mode": "static",
"global_mode": "cheapest",
"provider": "entrim",
"fallback": false,
"providers": [
{"slug": "entrim", "name": "Entrim", "country": "SI", "state": "available"},
{"slug": "arkane", "name": "Arkane", "country": "FR", "state": "switched_off"}
]
}
| Body | Meaning |
|---|---|
{"mode": "global"} | Remove the exception - the account's mode decides again |
{"mode": "cheapest" | "fastest" | "balanced"} | This model only |
{"mode": "static", "provider": "entrim"} | Every request for this model goes there, or fails |
{"mode": "static", "provider": "entrim", "fallback": true} | Same, but an outage answers from another provider |
curl -X PUT https://api.tinyhop.eu/mgmt/v1/models/deepseek-v4-1-flash-1017/routing \
-H "Authorization: Bearer $TINYHOP_MANAGE_KEY" \
-H "Content-Type: application/json" \
-d '{"mode": "static", "provider": "entrim", "fallback": true}'
global_mode says what global currently resolves to, so a client does not have to read the settings as well. state
in providers is available or switched_off - switched_off means your own provider switch excludes it, and a pin
never overrides that switch. An alias in the path is resolved first, so the pin lands on the model it points at.
| Status | Code | When |
|---|---|---|
| 400 | invalid_mode | Not one of global, cheapest, fastest, balanced, static |
| 400 | unknown_provider | Missing with static, not sold for this model, or retired |
| 400 | provider_switched_off | Your own provider switch excludes it - switch it on first |
A pin that could only ever produce a failing request is refused, not stored. The two codes stay apart because the fixes differ: one says ask us, the other says flip your own switch.
Usage
{"data": [
{"model": "glm-5-3", "provider": "entrim", "requests": 412, "tokens": 918273,
"cached_tokens": 1024, "cost": "0.4213", "p50_ms": 380, "p95_ms": 1240}
]}
One row per model and provider, days from 1 to 365 (default 30). cached_tokens is the part of tokens the provider
served from its cache - a subset, not an addition. p50_ms and p95_ms are null where nothing measured a first byte.
curl "https://api.tinyhop.eu/mgmt/v1/usage?days=7" -H "Authorization: Bearer $TINYHOP_MANAGE_KEY"
GET /mgmt/v1/usage/series?model=glm-5-3&days=30 is the same data per day for one model, which is what a chart needs:
{"days": 30, "model": "glm-5-3", "points": [
{"day": "2026-11-22", "requests": 12, "tokens": 31415, "cached_tokens": 0,
"cost": "0.012", "avg_latency_ms": 402}
]}
A day without traffic is a zero point, not a missing one.
Notices
{
"unread": 1,
"items": [
{
"id": "01K0…",
"created_at": "2026-11-22T08:00:00Z",
"severity": "critical",
"title": "Entrim is retiring glm-5-3 on 1 December",
"body": "Your static pin for that model points at Entrim. Move it before then.",
"link": "https://console.tinyhop.eu/models",
"dismissed_at": null
}
]
}
severity is critical (something of yours is broken right now), warning (something you rely on changed) or info.
dismissed_at is when you closed it; nothing is deleted. POST /notices/{id}/dismiss closes one and answers the full
list as it now stands, so the badge and the history are the same read.
API keys
GET /mgmt/v1/api-keys lists your keys - both scopes, in one list, with scope on each row. No key material: we store
a hash, and it cannot be shown again. last_used_at is the field worth watching - it is how a script notices a key in
use somewhere you did not expect.
There is no POST, PUT or DELETE here on purpose. Creating, rotating and revoking a key happens in the dashboard. A
key that could mint a key would be able to widen its own rights, and revoking the leaked one would not end the leak.
Export and deletion
GET /mgmt/v1/account/export streams everything we hold about the account as application/x-ndjson, one JSON object
per line, as a file download. Your data, as a file you keep.
DELETE /mgmt/v1/account ends the account and needs the password in the body - no key scope grants it, because the key
may sit in a config file on somebody's laptop:
curl -X DELETE https://api.tinyhop.eu/mgmt/v1/account \
-H "Authorization: Bearer $TINYHOP_MANAGE_KEY" \
-H "Content-Type: application/json" \
-d '{"password": "…"}'
{"deleted": true, "balance": "0"}
Refused with 401 wrong_password, or 409 account_gone when it was already deleted.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | The body is not JSON |
| 400 | invalid_body | A field is the wrong shape or outside its vocabulary |
| 400 | invalid_mode | mode is not one of the five |
| 400 | unknown_provider | A provider this account cannot use, or one that does not sell the model |
| 400 | provider_switched_off | A pin on a provider your own switch excludes |
| 400 | invalid_days | days outside 1 to 365 |
| 401 | invalid_api_key | Missing, unknown or revoked key |
| 401 | wrong_password | Account deletion, wrong password |
| 403 | insufficient_scope | An inference key on this surface |
| 404 | model_not_found, notice_not_found, user_not_found | The named thing does not exist for this account |
| 409 | account_gone | The account was deleted already |
| 429 | rate_limited | Over 60 requests per minute for the account; Retry-After says when |
| 500 | internal | Ours, not yours - worth a mail if it repeats |