Docs / Coding agents

Connect coding agents to Rota Nacional

Point your agent at Rota Nacional to apply the same privacy barrier and audit trail to its traffic.

Supported

Claude Code

Claude Code uses the Anthropic Messages API format (/v1/messages), rather than the OpenAI format. Rota Nacional translates it automatically. Configure it in ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://rota-nacional.ia.br",
    "ANTHROPIC_AUTH_TOKEN": "sk-rota-..."
  }
}

Or use an environment variable in your session: export ANTHROPIC_BASE_URL="https://rota-nacional.ia.br" and export ANTHROPIC_AUTH_TOKEN="sk-rota-...". Use an ID from the catalog (e.g. rota/agentes or rota/auto) as the model. Tool use and streaming work as usual.

Supported

OpenCode

OpenCode accepts any OpenAI-compatible endpoint through the @ai-sdk/openai-compatible. Configure it in opencode.json (project root or ~/.config/opencode/opencode.json):

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "rota-nacional": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Rota Nacional",
      "options": {
        "baseURL": "https://rota-nacional.ia.br/v1",
        "apiKey": "{env:ROTA_API_KEY}"
      },
      "models": {
        "rota/agentes": { "name": "Rota Agentes" }
      }
    }
  }
}

Supported

Pi

Pi Coding Agent accepts OpenAI-compatible endpoints through ~/.pi/agent/models.json (reloads automatically, without restarting):

{
  "providers": {
    "rota-nacional": {
      "baseUrl": "https://rota-nacional.ia.br/v1",
      "api": "openai-completions",
      "apiKey": "$ROTA_API_KEY",
      "models": [{ "id": "rota/agentes", "name": "Rota Agentes" }]
    }
  }
}

Not yet supported

Codex CLI

Since February 2026, Codex CLI uses the OpenAI Responses API (/v1/responses), rather than the Chat Completions format that Rota Nacional exposes at /v1/chat/completions. Pointing base_url to our domain does not currently work. We are evaluating an equivalent translation layer; check back or contact sales if this is your use case.