• Chat
  • Pricing
  • Blog
  • Downloads
  • API
    • Platform overview
    • Models
    • Rankings
    • API docs
    • Platform console
  • Company
    • About
    • Contact
    • Changelog
    • Roadmap
    • Contributors
  • Chat
  • Pricing
  • Blog
  • Downloads
  • API
    • Platform overview
    • Models
    • Rankings
    • API docs
    • Platform console
  • Company
    • About
    • Contact
    • Changelog
    • Roadmap
    • Contributors
Ditfa Platform
  • Overview
  • Models
  • Compare
  • Rankings
  • Docs
Open console
  • Overview
  • Authentication & SDKs
  • Chat completions
  • Models, key, credits
  • Billing & routing
  • Free & sponsored models
  • Errors & limits
  • Going to production
  • Plan API vs Platform
Create an API keyModel catalogGet support

API reference

Models, key and credits

Read the catalog, your key, your wallet and what a request cost.
On this page
  • List models
  • Get the current key
  • Get credits
  • Get a generation

List models#

Every published model with its context window, lowest available price and supported parameters. Cached for 60 seconds.

GEThttps://gateway.ditfa.com/v1/modelsPublic, no key

Request
curl https://gateway.ditfa.com/v1/models
200 OK
{
  "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) and request (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#

The calling key's spend limit, spend in the current period and allowed models.

GEThttps://gateway.ditfa.com/v1/keyRequires an sk-dp- key

Request
curl https://gateway.ditfa.com/v1/key \
  -H "Authorization: Bearer $DITFA_API_KEY"
200 OK
{
  "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#

The wallet balance of the account that owns the key.

GEThttps://gateway.ditfa.com/v1/creditsRequires an sk-dp- key

200 OK
{
  "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#

Final status, token counts, cost and timing of one request. Useful for streams and for reconciling spend.

GEThttps://gateway.ditfa.com/v1/generation?id=gen-…Requires an sk-dp- key

200 OK
{
  "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.

PreviousChat completionsNextBilling & routing

On this page

  • List models
  • Get the current key
  • Get credits
  • Get a generation
Terms of ServicePrivacy PolicyRefund PolicyAcceptable UseContact

© 2026 Ditfa. All rights reserved.

TeamtemGitHubHuggingface
  • Chat
  • Pricing
  • Blog
  • Downloads
  • API
    • Platform overview
    • Models
    • Rankings
    • API docs
    • Platform console
  • Company
    • About
    • Contact
    • Changelog
    • Roadmap
    • Contributors
  • Chat
  • Pricing
  • Blog
  • Downloads
  • API
    • Platform overview
    • Models
    • Rankings
    • API docs
    • Platform console
  • Company
    • About
    • Contact
    • Changelog
    • Roadmap
    • Contributors
Ditfa Platform
  • Overview
  • Models
  • Compare
  • Rankings
  • Docs
Open console

Your analytics choice

Allow Google Analytics to measure visits and public-page clicks so we can improve Ditfa? Optional analytics stays off until you choose. Privacy policy