Integrations · v1

Use it with your tools.

MyCoAI.dev drops into any AI coding tool that speaks OpenAI or Anthropic. Pick yours below — copy, paste, done.

Replay setup tour

§ 01Before you start

You need two things — both take under a minute.

  1. 01Sign up and create an API key in the dashboard.
  2. 02Note your base URL. We are OpenAI-compatible at https://mycoai.dev/v1 and Anthropic-compatible at https://mycoai.dev.

§ 02Codex CLI

OpenAI's CLI - the real one, open-source on GitHub. Put our provider block in ~/.codex/config.toml, then create a separate ~/.codex/myco.config.toml profile file for the model settings. Codex talks to our /v1/responses endpoint.

~/.codex/config.toml
toml
[model_providers.myco]
name = "MyCoAI.dev"
base_url = "https://mycoai.dev/v1"
wire_api = "responses"
env_key = "MYCO_API_KEY"
~/.codex/myco.config.toml
toml
model = "gpt-5.5"
model_provider = "myco"

Codex 0.134.0+ no longer reads legacy [profiles.*] entries from config.toml. Keep shared provider definitions in ~/.codex/config.toml, put model + model_provider in ~/.codex/myco.config.toml, then launch with codex --profile myco.

Then export your key and launch that profile:

shell
bash
export MYCO_API_KEY="sk-myco-..."
codex --profile myco

Add the export line to ~/.zshrc, ~/.bashrc, or PowerShell $PROFILE to keep the key set across sessions. Keep using codex --profile myco unless you set a separate default elsewhere.

Using the Codex desktop app? GUI processes don't inherit shell exports. Set the API key env var (the one named in env_key above) as a persistent OS variable - on Windows: System Properties > Environment Variables; on macOS: launchctl setenv or your login profile - then restart the app. If you use a named profile there too, keep the same ~/.codex/myco.config.toml file.

!

Set model to any model from your catalog that supports the Responses API. Codex was designed around OpenAI's gpt-5-codex; gpt-5.5 is a good cheap default. If you want a different default, make another profile config file such as ~/.codex/work.config.toml and start Codex with --profile work.

§ 03Claude Code

Anthropic's CLI. Three ways to point it at us — pick one. Global routes everything through us, per-project keeps your other repos on your normal account, shell is a one-shot.

Global (all projects)

Same JSON, just placed at the user-level config so every project on this machine picks it up automatically.

~/.claude/settings.json
json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://mycoai.dev",
    "ANTHROPIC_AUTH_TOKEN": "sk-myco-...",
    "ANTHROPIC_MODEL": "claude-sonnet-4-6",
    "ANTHROPIC_SMALL_FAST_MODEL": "claude-haiku-4-5-20251001",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}

Path: ~/.claude/settings.json on macOS and Linux · %USERPROFILE%\.claude\settings.json on Windows.

!

Sonnet and Opus pre-bill against your wallet at full max_tokens — Claude Code's first call needs around $1 of credit. On a fresh trial balance, swap ANTHROPIC_MODEL to claude-haiku-4-5-20251001 until you top up.

!

Claude models on MyCoAI are backed by Claude Code Max and are intended for the real Claude Code client. Raw Anthropic SDK /v1/messages calls can be rejected by the provider.

!

A per-project .claude/settings.json overrides this one. Drop a project-level file with your normal credentials anywhere you want to opt out.

Per-project

Drop this in the repo where you want to use our gateway. Other projects stay on your normal Claude account.

.claude/settings.json (in your project)
json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://mycoai.dev",
    "ANTHROPIC_AUTH_TOKEN": "sk-myco-...",
    "ANTHROPIC_MODEL": "claude-sonnet-4-6",
    "ANTHROPIC_SMALL_FAST_MODEL": "claude-haiku-4-5-20251001",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}
!

Keep this file in the project folder, not your home directory, so it never touches your global Claude Code setup. Add it to .gitignore so your key stays private.

Shell environment

Set the variables in your shell — affects just the current terminal.

shell
bash
export ANTHROPIC_BASE_URL="https://mycoai.dev"
export ANTHROPIC_AUTH_TOKEN="sk-myco-..."
claude

To make it stick across sessions, paste those export lines into your shell profile: ~/.zshrc, ~/.bashrc, or PowerShell $PROFILE.

ANTHROPIC_MODEL and ANTHROPIC_SMALL_FAST_MODEL pick which models Claude Code routes to — use any Claude model from your catalog.

§ 04OpenCode

Cross-platform code agent built on the Vercel AI SDK. Drop us in as a custom provider in your global opencode.json — every project on the machine picks it up.

~/.config/opencode/opencode.json
json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "myco": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "MyCoAI.dev",
      "options": {
        "baseURL": "https://mycoai.dev/v1",
        "apiKey": "sk-myco-..."
      },
      "models": {
        "gpt-5.5": {}
      }
    }
  },
  "model": "myco/gpt-5.5"
}

Path: ~/.config/opencode/opencode.json on macOS and Linux · %USERPROFILE%\.config\opencode\opencode.json on Windows.

Then run it from anywhere:

shell
bash
opencode run --model myco/gpt-5.5 "Hello"

§ 05OpenAI SDK

Set base_url — every existing call keeps working unchanged.

hello.py
python
from openai import OpenAI

client = OpenAI(
    api_key="sk-myco-...",
    base_url="https://mycoai.dev/v1",
)

resp = client.chat.completions.create(
    model="gpt-5.5",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)

§ 06Anthropic SDK

Use this section only for clients you have tested on /v1/messages. Current Claude models are intended for Claude Code, not generic raw Anthropic SDK calls.

!

For Claude Opus, Sonnet, and Haiku, use the Claude Code setup above. The Max provider checks for Claude Code client behavior and may reject ordinary SDK requests.

§ 07Image generation

Generate PNGs from a text prompt via the OpenAI-compatible /v1/images/generations endpoint. Works with the standard OpenAI SDK — just set base_url.

shell
bash
curl https://mycoai.dev/v1/images/generations \
  -H "Authorization: Bearer sk-myco-..." \
  -H "Content-Type: application/json" \
  --max-time 180 \
  -d '{
    "model": "gpt-image-2",
    "prompt": "a friendly orange cat sitting on a desk, illustration",
    "n": 1,
    "size": "1024x1024"
  }'
image.py
python
from openai import OpenAI
import base64

client = OpenAI(
    api_key="sk-myco-...",
    base_url="https://mycoai.dev/v1",
    timeout=180,  # generation takes 60-80s
)

resp = client.images.generate(
    model="gpt-image-2",
    prompt="a friendly orange cat sitting on a desk, illustration",
    n=1,
    size="1024x1024",
)

with open("out.png", "wb") as f:
    f.write(base64.b64decode(resp.data[0].b64_json))
!

Only gpt-image-2 is enabled right now. Generation takes 60–80 seconds — bump your HTTP client timeout to at least 180 seconds or the SDK will abort before the image arrives.

!

The response carries data[0].b64_json (a base64-encoded PNG), not a URL. Decode it and write the bytes to a file.

!

About $0.0061 per 1024×1024 image. Billed per image actually returned. Prompts blocked by the upstream safety filter come back as 400 moderation_blocked — rewrite the prompt.

Editing an existing image

Send a PNG plus a prompt to /v1/images/edits and gpt-image-2 returns an edited PNG. Same auth and SDK as generation — just use client.images.edit() and pass the source file. The endpoint is multipart/form-data (not JSON).

shell
bash
curl https://mycoai.dev/v1/images/edits \
  -H "Authorization: Bearer sk-myco-..." \
  --max-time 180 \
  -F "model=gpt-image-2" \
  -F "[email protected]" \
  -F "[email protected]" \
  -F "prompt=turn the sky blue and add a rainbow" \
  -F "n=1" \
  -F "size=1024x1024"
edit.py
python
from openai import OpenAI
import base64

client = OpenAI(
    api_key="sk-myco-...",
    base_url="https://mycoai.dev/v1",
    timeout=180,  # edits take 20-40s
)

with open("source.png", "rb") as img, open("mask.png", "rb") as mask:
    resp = client.images.edit(
        model="gpt-image-2",
        image=img,
        mask=mask,                # optional — omit to edit the whole image
        prompt="turn the sky blue and add a rainbow",
        n=1,
        size="1024x1024",
    )

with open("edited.png", "wb") as f:
    f.write(base64.b64decode(resp.data[0].b64_json))
!

Pass an optional mask PNG to restrict edits to specific regions — transparent pixels mark editable areas, opaque pixels are preserved. Omit the mask to let the model edit the whole image based on the prompt.

!

Edits take about 20–40 seconds. Source images must be under 4 MB. Keep the HTTP client timeout at 180 seconds to be safe.

!

Same price as generation — about $0.0084 per 1024×1024 image returned. Moderation rejections come back as 400 moderation_blocked.

§ 08Cline & Roo Code

VS Code extensions. In the provider dropdown choose OpenAI Compatible, then fill in these fields:

Provider
OpenAI Compatible
Base URL
https://mycoai.dev/v1
API Key
sk-myco-...
Model ID
gpt-5.5

§ 09Aider

Aider reads OpenAI-style environment variables. Point them at us and pick a model:

shell
bash
export OPENAI_API_BASE="https://mycoai.dev/v1"
export OPENAI_API_KEY="sk-myco-..."
aider --model openai/gpt-5.5

§ 10Any other client

Anything that lets you set a base URL and an API key works. Use the OpenAI surface for most tools, the Anthropic surface for Claude-native ones.

https://mycoai.dev/v1
OpenAI-compatible tools
Cursor, Continue, LibreChat, LM Studio, Open WebUI, LangChain, Vercel AI SDK.
https://mycoai.dev
Anthropic-compatible tools
Claude Code. Generic Anthropic SDK clients may not work with Max-backed Claude models unless you have tested that client.

§ 11Troubleshooting

  • 401 invalid_api_key
    Check the key is active in the dashboard and was copied whole, including the sk- prefix.
  • 402 insufficient_balance
    Top up your wallet — your balance is below the request's estimated cost.
  • 404 model_not_found
    The model is not in your catalog. Call GET /v1/models to see what is available to you.
  • slow first request
    The first call to a cold channel can lag. We fail over automatically when a channel is down.

Ready?

Grab a key from your dashboard and paste it into any tool above.

Go to API keys