• 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

Guides

Errors & limits

What can go wrong, what to do about it, and how much you can send.
On this page
  • Errors
  • Handling errors
  • Rate limits & quotas

Errors#

Errors use the OpenAI shape. Branch on error.code (stable); message is for humans and may change.
402 Payment Required
{
  "error": {
    "message": "Insufficient credits. Top up your wallet at https://platform.ditfa.com/credits.",
    "type": "payment_required",
    "code": "insufficient_credits",
    "param": null
  }
}
StatusCodeMeaningRetry?
400nullinvalid_request_errorThe body is not valid JSON, model or messages is missing, or the model rejected the parameters. The message names the problem.No
401missing_api_keyauthentication_errorNo Authorization: Bearer header was sent.No
401invalid_api_keyauthentication_errorThe key is malformed, wrong, disabled or deleted.No
401wrong_key_typeauthentication_errorA Plan API key (dt-…) was sent to Ditfa Platform. Platform keys start with sk-dp-.No
401key_expiredauthentication_errorThe key passed its expiry date.No
402insufficient_creditspayment_requiredAvailable credits cannot cover the reserved cost of this request. Add credits or lower max_tokens.No
402key_limit_reachedpayment_requiredThe key reached its own spend limit for the current period. Raise the limit or wait for the next period.No
402sponsorship_exhaustedpayment_requiredThe sponsored offer on this model has run out of budget.No
402sponsorship_endedpayment_requiredThe free or sponsored offer on this model has ended.No
402sponsorship_pausedpayment_requiredThe free or sponsored offer on this model is paused.No
403account_disabledpermission_errorThe account that owns the key cannot use the API. Contact support.No
403ip_not_allowedpermission_errorThe request came from an IP outside the key's allowlist.No
403model_not_allowedpermission_errorThe key's allowed-models list does not include this model.No
403no_allowed_providerpermission_errorNo provider of this model matches the key or account provider settings (verified providers only / no prompt logging).No
403free_not_eligiblepayment_requiredThis account does not qualify for the offer yet: it needs a verified email, or it is too new.No
403free_access_disabledpayment_requiredFree access to this model is turned off.No
403sponsorship_not_startedpayment_requiredThe free or sponsored offer on this model has not started yet.No
403wallet_frozenpayment_requiredThis account's Platform wallet is frozen. Contact support.No
404model_not_foundinvalid_request_errorThe model slug does not exist or is not published.No
404not_foundinvalid_request_error/generation: no request with this id belongs to your account.No
429rate_limit_exceededrate_limit_errorToo many requests per minute for this key, or from one IP address. Wait for the retry-after header.Yes
429model_overloadedrate_limit_errorEvery provider of this model is busy right now.Yes
429free_quota_exceededrate_limit_errorYour limit on this free or sponsored model is used up.After reset
429free_capacity_exhaustedrate_limit_errorThe allowance shared by everyone on this free or sponsored model is used up.After reset
429free_concurrency_limitrate_limit_errorToo many requests at once on this offer. Wait for one to finish.Yes
502upstream_unavailableserver_errorNo provider could serve the request. You are not charged.Yes
502upstream_errorserver_errorThe provider returned an unreadable response. You are not charged.Yes

Handling errors

Retry only 429 and 5xx, with exponential backoff and jitter, and honour retry-after. Treat 401, 402, 403 and 404 as configuration problems: retrying will not help.

free_quota_exceeded and free_capacity_exhausted are the 429s a quick retry will not fix: wait for the reset, or choose the normal price.

TypeScript
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://gateway.ditfa.com/v1',
  apiKey: process.env.DITFA_API_KEY,
  maxRetries: 3, // retries 429 and 5xx with backoff, honouring retry-after
});

try {
  const completion = await client.chat.completions.create({
    model: 'openai/gpt-4o-mini',
    messages: [{ role: 'user', content: 'Hello' }],
  });
  console.log(completion.choices[0].message.content);
} catch (error) {
  if (error instanceof OpenAI.APIError) {
    switch (error.code) {
      case 'insufficient_credits':
      case 'key_limit_reached':
        // Not retryable: alert someone to top up or raise the key limit.
        break;
      case 'model_not_found':
      case 'model_not_allowed':
        // Fix the model slug or the key's allowed models.
        break;
      default:
        console.error(error.status, error.code, error.message);
    }
  }
  throw error;
}

Used the wrong key?

A dt- key sent to Ditfa Platform (or an sk-dp- key sent to the Plan API) gets 401 wrong_key_type with a message that says which product it belongs to.

Rate limits & quotas#

LimitValue
Requests per key600 per minute by default. Read x-ratelimit-* headers on every response.
Requests per IP1,000 per minute across all keys from one address.
Active keys25 per account.
Top-up size$5 to $1,000 per payment; credits do not expire.
Default output cap16,384 tokens, or the model's maximum when lower. Set max_tokens to change it.
Context & max outputPer model; see /models or each model page.

Need a higher request rate? Contact us with your expected volume.

PreviousFree & sponsored modelsNextGoing to production

On this page

  • Errors
  • Handling errors
  • Rate limits & quotas
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