Tài liệu / App & SDK / Codex (OpenAI)

Codex (OpenAI)

Codex dùng địa chỉ chuẩn OpenAI qua Responses API: https://ai.gamikey.com/v1.

Đặt key vào biến môi trường ở terminal mở Codex:

bash
export GAMIKEY_API_KEY="sk-..."

Mở ~/.codex/config.toml (app desktop: Settings › Configuration › Open config.toml), thêm vào ĐẦU file:

toml
model_provider = "gamikey"
model = "gpt-6.2-sol"

[model_providers.gamikey]
name = "Gamikey AI"
base_url = "https://ai.gamikey.com/v1"
env_key = "GAMIKEY_API_KEY"
wire_api = "responses"
  • Hai dòng model_provider và model phải nằm trên mọi tiêu đề [...], nếu không sẽ bị bỏ qua.
  • Thoát hẳn Codex và mở tác vụ mới — tác vụ cũ giữ nhà cung cấp cũ.
  • Có thể đặt mã Claude cho model, ví dụ claude-sonnet-5-5.

Lỗi thường gặp

Codex báo "You’ve hit your usage limit" hoặc đòi đăng nhập ChatGPT: yêu cầu đang đi tới ChatGPT, chưa qua Gamikey. Chạy codex logout, kiểm tra 2 dòng ở đầu file, rồi mở codex từ terminal đã đặt GAMIKEY_API_KEY. Thử nhanh không cần sửa file:

bash
codex -c model_provider=gamikey
Cập nhật: 02/12/2026Thấy lỗi trong tài liệu? Chat với Gamikey