Skip to main content

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.

A manage key, not an inference key

Everything 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 https://api.tinyhop.eu/mgmt/v1/credits \
-H "Authorization: Bearer $TINYHOP_MANAGE_KEY"
{"currency": "EUR", "balance": "12.34", "reserved": "0.0004", "available": "12.3396"}

The endpoints​

MethodPathWhat it does
GET/accountWho owns the key, and the balance in one answer
GET/creditsOnly the three numbers - for a script that should not read your address
GET/settingsRouting mode, allowed providers, the quantization switch, requirements
PATCH/settingsChange one or more of them
GET/providersThe catalogue: slug, name, country, whether it can answer
GET/modelsEvery model you can reach, with every offer behind it
GET/models/{model}One row of that list
GET/models/{model}/routingThe per-model exception, and the providers you could pick
PUT/models/{model}/routingSet that exception
GET/usageRequests, tokens, cost and latency per model and provider
GET/usage/seriesOne model, day by day
GET/noticesThe inbox: what we told you, and what you closed
POST/notices/{id}/dismissClose one message
GET/api-keysYour keys, without the key material
GET/account/exportEverything we hold about the account, as a download
DELETE/accountEnd 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": []
}
FieldAcceptedRefused with
modecheapest, fastest, balanced400 invalid_mode
providers"all", or a list of provider slugs400 unknown_provider
allow_quantized_modelsbool400 invalid_body
requirementslist 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.

# 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}'

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
}
]
}
FieldMeaning
routingWhat follows for this model right now, in the dashboard's words: Global - Cheapest, Static - Entrim - Failover
providersThe slugs that can serve it, in ranking order
winnerThe 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_priceEuro per million tokens, input and output
offers[].cached_in_priceEuro per million cached prompt tokens; absent means the input price
offers[].ema_latency_msMeasured time to first byte; absent until something was measured
offers[].quantizationWhat 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"}
]
}
BodyMeaning
{"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.

StatusCodeWhen
400invalid_modeNot one of global, cheapest, fastest, balanced, static
400unknown_providerMissing with static, not sold for this model, or retired
400provider_switched_offYour 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​

StatusCodeWhen
400invalid_requestThe body is not JSON
400invalid_bodyA field is the wrong shape or outside its vocabulary
400invalid_modemode is not one of the five
400unknown_providerA provider this account cannot use, or one that does not sell the model
400provider_switched_offA pin on a provider your own switch excludes
400invalid_daysdays outside 1 to 365
401invalid_api_keyMissing, unknown or revoked key
401wrong_passwordAccount deletion, wrong password
403insufficient_scopeAn inference key on this surface
404model_not_found, notice_not_found, user_not_foundThe named thing does not exist for this account
409account_goneThe account was deleted already
429rate_limitedOver 60 requests per minute for the account; Retry-After says when
500internalOurs, not yours - worth a mail if it repeats