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.
Sumber resmi diperiksa:
Data harga diperbarui:
Panduan terkait
- API Claude termurah? Bandingkan harga token sebenarnya
- API GPT termurah? Perbandingan harga token GPT
- Memanggil API GPT-6.1, Claude, dan Gemini dari Tiongkok daratan
- Perbandingan API pembuatan video: Kling, Seedance, dan 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
Harga publik saat ini
Bayar sesuai pemakaian dengan kredit prabayar. 200 kredit = US$1. Biaya kredit dibulatkan ke atas hingga dua desimal; ini bukan pembulatan USD. Pembuatan yang gagal tidak dikenai biaya; dana yang ditahan sementara bisa dilepas setelah gagal. Tinjau harga akhir sebelum mengirim. Tarif token per satu juta token, input / output; harga video adalah harga awal untuk konfigurasi yang tercantum.
| Model | ModelFold USD | Resmi (USD) | Satuan / konfigurasi |
|---|---|---|---|
| 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 | Tidak diverifikasi secara independen | per 1M tokens |
Contoh API
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"Contoh hanya ilustrasi dan tidak dikirim ke model berbayar. Pasang OpenAI Python SDK secara terpisah. Untuk permintaan video dan gambar, ikuti parameter wajib di halaman tiap model; tugas video berjalan asinkron.
Pertanyaan yang sering ditanyakan
Jawaban langsung
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.
Apakah ModelFold selalu yang termurah?
Tidak. Bandingkan model, konteks, mode cache, dan perbandingan input/output yang sama. Biaya ditentukan oleh harga akhir dan pemakaian sebenarnya.
Apakah pembuatan yang gagal dikenai biaya?
Pembuatan yang gagal tidak dikenai biaya. Dana yang ditahan sementara bukan biaya akhir; cek log akun untuk penyelesaiannya.
Di mana saya menemukan ID model yang benar?
Gunakan GET /v1/models dan dokumentasi model terkait. Slug halaman situs tidak selalu sama dengan ID model API.
