Change one line. Keep your OpenAI SDK and your code. Use an sk-dp- key and any model from the catalog.
import osfrom openai import OpenAI client = OpenAI(Removed line: base_url="https://api.openai.com/v1",Added line: base_url="https://gateway.ditfa.com/v1", api_key=os.environ["DITFA_API_KEY"], # sk-dp-...) completion = client.chat.completions.create( model="openai/gpt-4o-mini", messages=[{"role": "user", "content": "Write a haiku about the ocean."}],) print(completion.choices[0].message.content)Read from the same catalog the API serves. Each price is the lowest across providers, in USD.
A model can have several providers. The gateway tries up to 3 of them in priority order and moves providers that are failing for several users to the back of the line.
Your app
POST /v1/chat/completions
Ditfa gateway
Checks the key, holds credits and picks providers
If a provider times out, returns 408, 429 or 5xx, or cannot be reached, the next one is tried automatically. Nothing has been sent to you yet, so fallback is invisible.
Prepaid USD credits, charged per token. No subscription and no usage windows.
Top up from $5 in the console. Eligible accounts can use free and sponsored models without a top-up.
Open creditsKeys start with sk-dp-. Set limits now or add them later.
Create a keyUse any OpenAI SDK with the Ditfa base URL.
Read the quickstartHost a model yourself, set your price per million tokens and reach every developer on Ditfa Platform. Ditfa reviews every seller.
What each provider does with your data, and the limits you set yourself.
Allow Google Analytics to measure visits and public-page clicks so we can improve Ditfa? Optional analytics stays off until you choose. Privacy policy
Change one line. Keep your OpenAI SDK and your code. Use an sk-dp- key and any model from the catalog.
import osfrom openai import OpenAI client = OpenAI(Removed line: base_url="https://api.openai.com/v1",Added line: base_url="https://gateway.ditfa.com/v1", api_key=os.environ["DITFA_API_KEY"], # sk-dp-...) completion = client.chat.completions.create( model="aion-labs/aion-3.5", messages=[{"role": "user", "content": "Write a haiku about the ocean."}],) print(completion.choices[0].message.content)| Model | Input / 1M | Output / 1M | Context |
|---|---|---|---|
| Aion 3.5aion-labs | $3.26 | $6.52 | 262K |
| Aion 3.5 Miniaion-labs | $0.761 | $1.52 | 262K |
| Aion-2.0aion-labs | $0.869 | $1.74 | 131K |
| Aion-3.0aion-labs | $3.26 | $6.52 | 131K |
| Aion-3.0-Miniaion-labs | $0.761 | $1.52 | 131K |
| Aion-RP 1.0 (8B)aion-labs | $0.869 | $1.74 | 33K |
| Beam 1.0 501B A23Breflection | $0.272 | $1.09 | 1.05M |
A $5 top-up covers about 511 of these.
Live lowest price, with the same rounding as billing. You are billed at the rate of the provider that answers.