GetToken Docs

Configure GetToken by topic

Short, focused guides for API Keys, base_url values, Codex App, Codex CLI, OpenCode, CC Switch, and image generation skill setup.

View my API Key

Sign in, reveal your current GetToken API Key, then copy it into Codex or OpenCode.

Tool Setup

Use a Codex Skill to Generate Images

Learn how to use imagegen-compatible Skill for Codex image generation when using the GetToken relay service.

When using the GetToken relay service, Codex cannot generate images directly through the built-in client ImageGen.

Built-in ImageGen needs a key that can connect directly to the OpenAI Images API. GetToken provides a relay service API key, and that key does not take over the direct ImageGen path inside Codex.

Therefore, image generation with the GetToken relay service must use the imagegen-compatible Skill.

Ask Codex to Install It

You can send this directly to Codex:

text
Please install this Codex skill: https://cnb.cool/youidian/imagegen-compatible

Requirements:
1. Clone the repository to ${CODEX_HOME:-$HOME/.codex}/skills/imagegen-compatible.
2. Before installation, check whether the target directory already exists. If it exists, ask me whether to update, overwrite, or skip. Do not delete it directly.
3. After installation, confirm SKILL.md, scripts/image_gen.py, agents/openai.yaml, and references/config.md exist.
4. If ~/.codex/skills/.system/skill-creator/scripts/quick_validate.py exists, run it to validate the skill.
5. Remind me to restart Codex.

Restart Codex after installation.

Requirement

When generating images in Codex, image generation tasks must be handled by imagegen-compatible.

Do not use:

  • Built-in Codex ImageGen
  • Image generation paths that depend on an official OpenAI direct key

Use:

  • imagegen-compatible Skill
  • GetToken API Key
  • OpenAI-compatible Images API endpoint

Configure the Endpoint

imagegen-compatible reads two environment variables:

text
OPENAI_API_KEY
OPENAI_BASE_URL

macOS / Linux:

bash
export OPENAI_API_KEY="<your GetToken API Key>"
export OPENAI_BASE_URL="https://api.gettoken.dev/v1"

Windows PowerShell:

powershell
$env:OPENAI_API_KEY = "<your GetToken API Key>"
$env:OPENAI_BASE_URL = "https://api.gettoken.dev/v1"

Do not put real API keys in public repositories or public screenshots.

Install Location

The Skill must be installed under the .codex/skills directory used by the environment where Codex actually runs.

macOS / Linux:

text
${CODEX_HOME:-$HOME/.codex}/skills/imagegen-compatible

Windows PowerShell:

text
$env:USERPROFILE\.codex\skills\imagegen-compatible

Windows WSL:

text
~/.codex/skills/imagegen-compatible

If Codex runs in WSL, install the Skill inside WSL. If Codex runs in native Windows, install it under the Windows user directory.

Troubleshooting

Why not use built-in ImageGen directly

Built-in Codex ImageGen requires a key that can connect directly to the OpenAI Images API. When using the GetToken relay service, that direct path does not work, so imagegen-compatible must handle image generation.

Codex Cannot Find the Skill

Confirm the Skill is installed under the .codex/skills directory used by the active Codex environment, then restart Codex.

Windows Installation Does Not Work

Confirm whether Codex runs in native Windows or WSL. The Skill must be installed in the same environment.

Generation Fails

Check:

  1. OPENAI_API_KEY is correct.
  2. OPENAI_BASE_URL includes /v1.
  3. The current endpoint supports the Images API.
  4. The output directory exists or is writable.