본문으로 건너뛰기
노트
이 페이지는 아직 번역되지 않아 영어로 표시됩니다.

Run your coding agent on OceanToken

Point the agent's own model at OceanToken and its requests run on your OceanToken key and balance, with any suitable model from the Models page. This is separate from adding OceanToken's tools to an agent; you can do either or both.

Before you start​

  1. Create an API key for the agent and give it a Credit limit. Agents send many requests, and the limit caps what this one can spend.

  2. Keep the key in an environment variable, never in a file in your repository:

    export OCEANTOKEN_API_KEY=sk-...
  3. Check it:

    curl -s https://api.oceantoken.ai/v1/models -H "Authorization: Bearer $OCEANTOKEN_API_KEY" | head -c 300

Codex​

With one command​

npx -y @oceantoken/cli@latest use codex

It needs Node.js 18.17 or newer. The command opens the API keys page of the console and asks you to paste a key, which it does not show. It saves the key in config.toml and makes the file readable only by you. Then it makes OceanToken Codex's default provider, with openai/gpt-5.5: it adds a [model_providers.oceantoken] table to ~/.codex/config.toml and sets model_provider and model at the top level, above the first table. Your own model line is commented out, not deleted, and the file is backed up first as config.toml.bak-oceantoken.

  • --use-env-key takes the key from OCEANTOKEN_API_KEY and keeps it out of the file: Codex reads the variable itself, so export it in your shell profile.
  • --model <model id> starts with another model, for example --model deepseek/deepseek-v4.1-flash.
  • npx -y @oceantoken/cli@latest unuse codex removes what it added and puts your own lines back.

If you set up Codex by hand from the steps below, use codex stops and asks you to remove your own [model_providers.oceantoken] table first.

Start a new Codex session and run codex as usual. To check the setup:

codex exec --skip-git-repo-check -m deepseek/deepseek-v4.1-flash "Reply with the single word OK"

By hand​

Codex 0.135 and later keep each profile in its own file next to config.toml (check with codex --version). Two additions put OceanToken one flag away and leave your default setup as it is. Back up ~/.codex/config.toml before you edit it.

  1. Append the provider to ~/.codex/config.toml. On its own it changes nothing:

    [model_providers.oceantoken]
    name = "OceanToken"
    base_url = "https://api.oceantoken.ai/v1"
    env_key = "OCEANTOKEN_API_KEY"
    wire_api = "responses"
  2. Create ~/.codex/oceantoken.config.toml with two lines and no table header:

    model_provider = "oceantoken"
    model = "openai/gpt-5.5"

Run Codex with codex --profile oceantoken, and check the setup with:

codex exec --skip-git-repo-check --profile oceantoken "Reply with the single word OK"

Codex sends about 12,000 to 16,000 tokens of its own instructions with every request, so even this check costs a few cents on openai/gpt-5.5. Add -m deepseek/deepseek-v4.1-flash to run it for a fraction of that.

Plain codex, without --profile, runs your usual setup, so that is how you switch back. To remove OceanToken, delete oceantoken.config.toml and the [model_providers.oceantoken] table.

  • Set up from an earlier version of this page? Delete the [profiles.oceantoken] table from config.toml. Codex 0.135 and later refuse --profile oceantoken while it is there.
  • Codex 0.134 or earlier has no profile files: put the same two lines under a [profiles.oceantoken] table in config.toml instead.
  • OceanToken as the default, with no flag: put the two lines at the top of config.toml, above the first [table], in place of any model or model_provider line already there. To switch back, restore those lines from your backup. This is what use codex does for you.

Choose a model​

Codex runs tools on almost every turn, so choose a model that handles tool calls well. Each of these completed a coding task with Codex's own tools (writing a file and running it) in Codex 0.154 on 2026-10-19:

모델 ID컨텍스트 윈도우최대 출력이미지가격
openai/gpt-5.5922,000128,000예oceantoken.ai에서 확인
anthropic/claude-sonnet-5.51,000,000128,000예oceantoken.ai에서 확인
deepseek/deepseek-v4.1-flash1,048,576943,718예oceantoken.ai에서 확인
qwen/qwen3.8-max-0902983,616131,072예oceantoken.ai에서 확인

Switch for one run with -m <model id>, or change model in your config. deepseek/deepseek-v4.1-flash is the low-cost choice: in our tests the same task cost 40 to 80 times less than on openai/gpt-5.5, depending on how much of the prompt was cached. Claude models got no cached-input discount in Codex in our tests, so every turn is billed at their full input price.

With any model that is not OpenAI's, Codex prints this at the start of a session:

warning: Model metadata for `deepseek/deepseek-v4.1-flash` not found. Defaulting to fallback metadata; this can degrade performance and cause issues.

It is harmless. Codex has no built-in profile for the model and uses general defaults; the model and Codex's tools work as usual.

Codex sends no reasoning effort unless you set one (its header line reads reasoning effort: none). For harder tasks, set it for one run with -c model_reasoning_effort="medium" (low, medium or high), or add model_reasoning_effort = "medium" to oceantoken.config.toml. More effort means more output tokens, so more cost.

Avoid aion-labs/aion-2.0 for Codex and other agents that run tools: after a tool call it tends to write its final answer into its reasoning, so the turn shows no answer. It is fine for plain chat.

Claude Code​

Claude Code speaks the Anthropic Messages API, which OceanToken serves for every chat model. For one project, put this in .claude/settings.local.json, which git ignores; for every project, in ~/.claude/settings.json:

{
"env": {
"ANTHROPIC_BASE_URL": "https://api.oceantoken.ai",
"ANTHROPIC_AUTH_TOKEN": "<your OceanToken key>",
"ANTHROPIC_MODEL": "anthropic/claude-sonnet-5.5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "anthropic/claude-haiku-4.5"
}
}

ANTHROPIC_BASE_URL has no /v1: like the Anthropic SDK, Claude Code adds it itself. Use model names exactly as the Models page lists them. Check the setup with:

claude -p "Reply with the single word OK"

The settings file holds the key in plain text. Prefer the project-local file, keep it out of git, and remember where it is.

Cline, Kilo Code and Zoo Code​

These VS Code agents each have their own page, with the settings they ask for and the models tested with them: Cline, Kilo Code and Zoo Code, which also covers Roo Code.

Other tools​

Any tool that lets you set an OpenAI-compatible base URL and key works the same way: base URL https://api.oceantoken.ai/v1, your OceanToken key, and a model name from the Models page. A tool that speaks the Anthropic API takes https://api.oceantoken.ai and a Claude model.

goose has its own page, with a provider file you download. For apps built on the Vercel AI SDK, see Vercel AI SDK.

Costs​

Every request the agent makes is an ordinary API request: charged to your balance at the model's price and listed in the console under Logs. Agents resend long prompts on every turn, so a model's Cached input price (on its page on oceantoken.ai) matters as much as its input price. If a key may have leaked, rotate it.