API reference
Models, key and credits
List models
GEThttps://gateway.ditfa.com/v1/modelsPublic, no key
curl https://gateway.ditfa.com/v1/models{
"data": [
{
"id": "openai/gpt-4o-mini",
"name": "GPT-4o mini",
"author": "openai",
"created": 1721260800,
"description": "…",
"context_length": 128000,
"architecture": {
"input_modalities": [
"text",
"image"
],
"output_modalities": [
"text"
]
},
"pricing": {
"prompt": "0.000000155",
"completion": "0.000000618",
"input_cache_read": "0.0000000773",
"request": "0"
},
"top_provider": {
"context_length": 128000,
"max_completion_tokens": 16384
},
"supported_parameters": [
"max_tokens",
"temperature",
"top_p",
"stop",
"tools",
"tool_choice"
]
}
]
}Fields
idstring- The slug to pass as model.
pricingobject- USD per token as decimal strings (OpenRouter format):
prompt,completion,input_cache_read(absent when the model has no cached-input price) andrequest(fixed fee per request). Multiply by 1,000,000 for the per-million price shown on model pages. context_lengthinteger- Maximum context window in tokens.
top_providerobject- Context window and max output tokens of the provider behind the listed price.
architectureobject- input_modalities and output_modalities, e.g. ["text", "image"].
supported_parametersstring[]- Parameters known to work with this model. Not a complete list: every field under Chat Completions is forwarded, and support varies by provider.
Get the current key
GEThttps://gateway.ditfa.com/v1/keyRequires an sk-dp- key
curl https://gateway.ditfa.com/v1/key \
-H "Authorization: Bearer $DITFA_API_KEY"{
"data": {
"limit": 50,
"limit_period": "month",
"usage": 12.4,
"limit_remaining": 37.6,
"allowed_models": []
}
}Amounts are USD. limit and limit_remaining are null when the key has no spend limit; usage is then the key's lifetime spend.
Get credits
GEThttps://gateway.ditfa.com/v1/creditsRequires an sk-dp- key
{
"data": {
"balance": 24.5,
"reserved": 0.02,
"available": 24.48
}
}reserved is held for requests in flight; available = balance − reserved is what new requests can use.
Get a generation
GEThttps://gateway.ditfa.com/v1/generation?id=gen-…Requires an sk-dp- key
{
"data": {
"id": "gen-3f1c2a7e-8b4d-4c1e-9a0f-5d6e7b8c9d0e",
"model": "openai/gpt-4o-mini",
"created_at": "2026-10-30T09:12:44.512Z",
"status": "ok",
"streamed": true,
"tokens_prompt": 14,
"tokens_completion": 17,
"tokens_cached": 0,
"tokens_reasoning": 0,
"total_cost": 0.000013,
"latency_ms": 812,
"ttft_ms": 241
}
}total_cost is the USD amount charged. status is ok, error or canceled; ttft_ms (time to first token) is set for streams. Usage is written once the request finishes, so query it after the response or stream ends. Any key of the same account can read it.