1. AI application
PeakkAI-Doc
English
  • 中文
  • English
  • 首页
  • English
    • Home Page
    • PeakkAI-API
      • Model
        • Native OpenAI Format
        • Native Gemini Format
      • Chat
        • Native OpenAI Format
        • Native Gemini Format
        • Native Claude Format
        • Responses Request (openai)
      • Audio
        • Native OpenAI Format TTS
        • Native Gemini Format TTS
      • Images
        • Native OpenAI Format Image Editing (JSON)
        • Native OpenAI Format Image Generation
        • Native OpenAI Format Image Editing (Multipart)
        • Native Gemini Format Image Generation
      • Video
        • Seedance2.0 format
          • Create Video Generation Task
          • Query Video Generation Task Status
      • Vector
        • Embeddings
          • Create Embedding
      • Translation
        • Speech Translation
    • AI application
      • PeakkAI API Integration with Claude Code
      • PeakkAI API Integration with Cursor
      • PeakkAI API Integration with Codex-cli
      • PeakkAI API Integration with Codex Desktop
      • PeakkAI API Integration with Hermes Agent
  1. AI application

PeakkAI API Integration with Codex Desktop

PeakkAI Integration with Codex Desktop Tutorial#

This tutorial applies to:
OpenAI Codex Desktop
PeakkAI API
macOS
Windows
OpenAI Compatible API

I. What is Codex Desktop#

Codex Desktop is a desktop AI programming assistant launched by OpenAI.
Compared to traditional chat windows, Codex Desktop supports:
Code repository analysis
AI Agents
Automatic project modification
Shell execution
Git operations
Multi-task parallelism
Local tool invocation
Developers can directly use their own API service providers without being forced to use the official OpenAI API.

II. Does PeakkAI Support Codex Desktop?#

Yes.
PeakkAI provides an OpenAI Compatible/Responses API.
Therefore, it can be directly integrated into Codex Desktop as a:
Custom Provider
OpenAI Compatible Endpoint
Integration can be completed simply by configuring the:
API Key
Base URL
Model

III. Prerequisites#

Prepare the following items:
ItemDescription
Codex DesktopInstalled
PeakkAI API Keysk-xxxx
PeakkAI API URLhttps://api.peakk.ai/v1
Model Namegpt-5.2

IV. Download and Install Codex Desktop#

Go to the official OpenAI download page to install the latest version of Codex Desktop:
https://openai.com/zh-Hans-CN/codex/get-started/
Launch the application after the installation is complete.

V. Get PeakkAI API Information#

Go to the PeakkAI Open Platform to apply for your secret key (sk).
peakk Open Platform
image-20260514140602533.png
image-20260514140819323.png
Obtain the following information:
Configuration ItemExample
Base URLhttps://api.peakk.ai
API Keysk-xxxx
ModelClaude Opus 4.6 / GPT 5.2 ...

VI. Configuration via Environment Variables (The OpenAI Recommended Integration Method)#

Codex CLI essentially uses the OpenAI SDK, so you only need to configure environment variables.
However, this method is only applicable to OpenAI-related models.
Supported examples: GPT-5.2, GPT-5.5
Unsupported examples: Claude Haiku 4.5, Gemini 2.5 Pro (These are not supported via this method)

1. Mac / Linux Configuration#

Open your terminal:
Add the following lines:
image.png
Save the file and run:

2. Windows Configuration (Command Line Method)#

Open either:
CMD
PowerShell
Windows Terminal
Then execute the following commands.

CMD Configuration Method#

Set API Key#

setx OPENAI_API_KEY "sk-xxxx"

Set Base URL#

setx OPENAI_BASE_URL "https://api.peakk.ai/v1"

Set Model#

setx OPENAI_MODEL "gpt-5.2"

After Configuration#

Close the current terminal window.
Reopen CMD or PowerShell.
Verify the configuration:
echo %OPENAI_API_KEY%
echo %OPENAI_BASE_URL%
echo %OPENAI_MODEL%

VII. Verify Configuration#

Open Codex Desktop.
Confirm whether the API has been correctly configured and test if it works properly, as shown below:
image.png
Alternatively, type a prompt like:
Help me generate a Spring Boot sample project.
If it returns the results successfully, it indicates that:
The API Key is correct.
The Base URL is correct.
The Model is correct.
PeakkAI has been successfully integrated.

VIII. Troubleshooting / FAQ#

Unauthorized#

Check if the:
API Key is correct

Provider Connection Failed#

Check whether the URL:
https://api.peakk.ai/v1
is entered correctly.

Model Not Found#

Check the model name.
Make sure you have entered:
gpt-5.2
or any other model supported by the PeakkAI platform.

IX. Summary#

By utilizing the Custom Provider feature in Codex Desktop, you can directly integrate the PeakkAI OpenAI Compatible API.
Once configuration is complete, you can use models like:
GPT-5.2
GPT-5.5
in Codex Desktop, achieving a unified API and a multi-model AI programming experience.
修改于 2026-11-02 09:46:29
上一页
PeakkAI API Integration with Codex-cli
下一页
PeakkAI API Integration with Hermes Agent
Built with