Point Codex CLI at a third-party API
In the user-level ~/.codex/config.toml, set base_url to https://modelfold.ai/openai/v1, env_key to MODELFOLD_API_KEY, and model to a slug from GET /openai/v1/models; Codex appends /responses itself.
Codex ignores model_provider in a project-level config file. The reserved provider ids openai, ollama and lmstudio cannot be overridden. The table shows ModelFold public prices for the linked catalog pages; a grouped page is one catalog row, so confirm the exact slug on the model list before a long task.
Geprüfte offizielle Quellen:
Preisstand aktualisiert:
Verwandte Leitfäden
- Die günstigste Claude-API? Tatsächliche Tokenpreise im Vergleich
- Die günstigste GPT-API? GPT-Tokenpreise im Vergleich
- GPT-6.1-, Claude- und Gemini-APIs aus Festlandchina aufrufen
- APIs zur Videogenerierung im Vergleich: Kling, Seedance und Veo
- Use Claude Code with a mainland-reachable API base URL
- Point Codex CLI at a third-party API
- Cheaper Cursor setup with your own API key
- Kling, Veo and Seedance API prices on ModelFold
- Nano Banana and GPT Image API prices
- Call the Gemini API from mainland China
- DeepSeek vs Claude: coding API price on ModelFold
- AI API pay as you go versus a subscription
- Call every listed model with one API key
Aktuelle öffentliche Preise
Bezahlung nach Verbrauch mit Prepaid-Credits. 200 Credits = 1 US-$. Credit-Beträge werden auf zwei Nachkommastellen aufgerundet; das ist keine USD-Rundung. Fehlgeschlagene Generierungen werden nicht berechnet; eine vorübergehende Reservierung kann nach dem Fehler freigegeben werden. Prüfen Sie vor dem Absenden den endgültigen Preis. Tokenpreise gelten pro einer Million Token, Eingabe / Ausgabe; Videopreise sind Einstiegspreise für die angegebene Konfiguration.
| Modell | ModelFold USD | Offiziell (USD) | Einheit / Konfiguration |
|---|---|---|---|
| GPT-6 Astra | 3.36 in / 16.80 out | $10 / $50 | per 1M tokens |
| GPT 6.1 Sol | 0.72 in / 3.60 out | $2 / $10 | per 1M tokens |
| GPT-6 Luna | 0.036 in / 0.18 out | $0.1 / $0.5 | per 1M tokens |
| GPT-6 Sol | 0.72 in / 3.60 out | Nicht unabhängig verifiziert | per 1M tokens |
API-Beispiele
curl https://modelfold.ai/v1/models -H "Authorization: Bearer $MODELFOLD_API_KEY"model = "gpt-6-astra"
model_provider = "ModelFold"
[model_providers.ModelFold]
name = "ModelFold"
base_url = "https://modelfold.ai/openai/v1"
env_key = "MODELFOLD_API_KEY"
wire_api = "responses"curl https://modelfold.ai/openai/v1/models \
-H "Authorization: Bearer $MODELFOLD_API_KEY"Die Beispiele dienen der Veranschaulichung und wurden nicht an ein kostenpflichtiges Modell gesendet. Installieren Sie das OpenAI Python SDK separat. Für Video- und Bildanfragen gelten die Pflichtparameter der jeweiligen Modellseite; Videoaufträge laufen asynchron.
Häufig gestellte Fragen
Direkte Antwort
In the user-level ~/.codex/config.toml, set base_url to https://modelfold.ai/openai/v1, env_key to MODELFOLD_API_KEY, and model to a slug from GET /openai/v1/models; Codex appends /responses itself.
Should base_url end in /responses?
No. Codex appends /responses. Use https://modelfold.ai/openai/v1, or the request path becomes /responses/responses.
Can the provider live in the project .codex folder?
No. Put model_provider in the user-level file. On macOS and Linux that is ~/.codex/config.toml. A project file is skipped.
Can I keep Codex’s built-in model name?
No. model must be a slug from GET /openai/v1/models. Testing recorded that gpt-5.6-luna replied with text and did not call Codex tools; do not use it as a coding model.
Ist ModelFold immer am günstigsten?
Nein. Vergleichen Sie dasselbe Modell, denselben Kontext, denselben Cache-Modus und dasselbe Verhältnis von Ein- zu Ausgabe. Maßgeblich für die Kosten sind der endgültige Preis und die tatsächliche Nutzung.
Werden fehlgeschlagene Generierungen berechnet?
Fehlgeschlagene Generierungen werden nicht berechnet. Eine vorübergehende Reservierung ist keine endgültige Belastung; die Abrechnung sehen Sie in den Kontoprotokollen.
Wo finde ich die richtige Modell-ID?
Nutzen Sie GET /v1/models und die verlinkte Modelldokumentation. Der Pfad einer Webseite ist nicht immer die API-Modell-ID.
