• 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

Get started

Authentication & SDKs

Send a key with every request, and scope each key to what it needs.
On this page
  • Authentication
  • SDKs & frameworks

Authentication#

Every endpoint except GET /models needs a key, sent as a bearer token:

Authorization: Bearer sk-dp-…

Keys are stored hashed; the full key is shown once when you create it. Each key can be scoped in the dashboard:

SettingEffect
Spend limitPer day, week, month or in total. Windows are UTC; weeks start on Monday. Requests over the limit get 402 key_limit_reached.
Allowed modelsOnly these slugs can be called. Empty means every published model.
IP allowlistExact IPv4/IPv6 addresses. Empty means any IP.
Expiry dateAfter it, the key gets 401 key_expired.
Provider policyVerified providers only (no marketplace sellers) and/or no providers that log prompts. Also settable for the whole account.

Disable a key to pause it, or delete it to revoke it for good; request history is kept either way. Key changes take effect within a few seconds. Up to 25 keys can be active per account.

Keep keys on the server

The gateway accepts browser (CORS) requests, but a key in client-side code can be read and spent by anyone. Call the API from your backend, or use a separate key with a low spend limit and an allowlist.

SDKs & frameworks#

Anything that speaks the OpenAI Chat Completions API works: change the base URL and the key.
ClientConfiguration
OpenAI PythonOpenAI(base_url=…, api_key=…)
OpenAI Node / TypeScriptnew OpenAI({ baseURL, apiKey })
Vercel AI SDKcreateOpenAICompatible({ name: "ditfa", baseURL, apiKey })
LangChainChatOpenAI(base_url=…, api_key=…, model=…)
Tools that read env varsOPENAI_BASE_URL=https://gateway.ditfa.com/v1 OPENAI_API_KEY=sk-dp-…
Only Chat Completions is available. The Responses, Embeddings, Images and Audio endpoints of the OpenAI API are not served by the gateway.
PreviousOverviewNextChat completions

On this page

  • Authentication
  • SDKs & frameworks
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