> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portkey.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Coding Agents

> The governance layer for Claude Code, Codex, and other AI coding agents — centralized credentials, cost controls, observability, and provider failover for platform teams.

When developers use Claude Code or Codex individually, it works fine. When 100 developers use it — raw API keys get scattered, costs spike overnight without attribution, and there's no fallback when a provider goes down.

Portkey is the gateway that sits between your team's coding agents and LLM providers. **Developers change nothing. You get full control.**

<CardGroup cols={3}>
  <Card title="Secure" icon="shield-check">
    Centralize provider credentials. Issue scoped API keys per team. Rotate or revoke access without touching developer configs.
  </Card>

  <Card title="Control" icon="sliders">
    Set hard budget and rate limits per developer, team, or workspace. Block requests when limits are hit.
  </Card>

  <Card title="Observe" icon="chart-line">
    Log every request — cost, tokens, latency, model, and who made it. Attribute spend by team or project.
  </Card>
</CardGroup>

***

## Supported agents

<CardGroup cols={2}>
  <Card title="Claude Code" icon="terminal" href="/integrations/libraries/claude-code">
    The most widely deployed AI coding agent. Supports Anthropic direct, Bedrock, and Vertex AI through a single Portkey endpoint.
  </Card>

  <Card title="OpenAI Codex" icon="code" href="/integrations/libraries/codex">
    OpenAI's terminal coding agent. Configure via `config.toml` with full provider flexibility.
  </Card>

  <Card title="Cursor" icon="arrow-pointer" href="/integrations/libraries/cursor">
    Route Cursor's AI requests through Portkey for observability and cost controls.
  </Card>

  <Card title="Cline" icon="brackets-curly" href="/integrations/libraries/cline">
    Set Portkey as Cline's custom OpenAI base URL.
  </Card>

  <Card title="Roo Code" icon="code-branch" href="/integrations/libraries/roo-code">
    Drop-in Portkey integration via base URL override.
  </Card>

  <Card title="Pi Agent" icon="terminal" href="/integrations/libraries/pi-agent">
    Minimal extensible terminal coding agent. Route through Portkey via custom provider config.
  </Card>

  <Card title="Goose, opencode & more" icon="grid" href="/integrations/libraries/opencode">
    Any OpenAI-compatible coding agent works with Portkey.
  </Card>
</CardGroup>

***

## What platform teams get

### Access control

Developers never see provider credentials. Every request is authenticated through a scoped Portkey key.

| Goal                      | What to use                                                                      | Description                                                                                                                         |
| ------------------------- | -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Centralize credentials    | [Model Catalog](/product/model-catalog)                                          | Store Anthropic, Bedrock, and Vertex keys once. Issue scoped Portkey keys to teams — no raw key distribution.                       |
| Isolate teams             | [Workspaces](/product/enterprise-offering/org-management/workspaces)             | Each team gets its own workspace with separate budgets, rate limits, and provider access. One team's usage never affects another's. |
| Manage team access        | [API Keys](/product/enterprise-offering/org-management/api-keys-authn-and-authz) | One key per developer or team. Rotate or revoke from one place without touching developer configs.                                  |
| Provision access at scale | [SSO / SCIM](/product/enterprise-offering/org-management/sso)                    | Connect your identity provider. Onboard and offboard developers automatically.                                                      |

### Cost management

Agentic loops are expensive. One uncapped session can rack up hundreds of dollars overnight.

| Goal                       | What to use                                                     | Description                                                                                                |
| -------------------------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| Cap team spending          | [Budget Policies](/product/enterprise-offering/budget-policies) | Hard spend limits per developer, team, or workspace. Requests block when the limit is hit.                 |
| Prevent traffic starvation | [Rate Limits](/product/model-catalog/rate-limits)               | Stop any single user from consuming shared provider capacity.                                              |
| Attribute costs by team    | [Logs + Metadata](/product/observability/metadata)              | Every request logged with team, project, model, tokens, and exact cost. Answer spend questions in seconds. |

<Frame>
  <img src="https://mintcdn.com/portkey-docs/28zFZsk9XnqGMtZ6/images/cost.png?fit=max&auto=format&n=28zFZsk9XnqGMtZ6&q=85&s=03cb0b4f80f27963dcc2d8d0c9bc2dd8" alt="Per-request cost breakdown and metadata filters in Portkey" width="2940" height="1764" data-path="images/cost.png" />
</Frame>

### Reliability

Coding agents fail silently when providers go down. Portkey routes around outages automatically.

| Goal                     | What to use                                          | Description                                                                         |
| ------------------------ | ---------------------------------------------------- | ----------------------------------------------------------------------------------- |
| Survive provider outages | [Fallbacks](/product/ai-gateway/fallbacks)           | Auto-retry on Bedrock or Vertex if Anthropic goes down — no developer intervention. |
| Handle team-scale volume | [Load Balancing](/product/ai-gateway/load-balancing) | Distribute traffic across providers and API keys.                                   |

### Governance

Coding agents operate with terminal-level access. Portkey adds the control layer.

| Goal                        | What to use                                           | Description                                                                                      |
| --------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| Protect sensitive codebases | [Guardrails](/product/guardrails)                     | PII detection, prompt injection protection, and content filtering before requests hit the model. |
| Govern MCP tool access      | [MCP Gateway](/product/mcp-gateway)                   | Centralized auth and full call logs for every MCP tool your agents use.                          |
| Maintain a compliance trail | [Audit Logs](/product/enterprise-offering/audit-logs) | Immutable record of every access, config change, and policy action across the org.               |
| Share coding standards      | [Agent Skills](/guides/coding-agents/skills)          | Version prompt instructions and sync them to every developer's agent with one command.           |

***

## Setting up Claude Code and Codex

For Claude Code and Codex, the [Portkey CLI](/guides/coding-agents/agent-cli) sets up gateway routing, MCP servers, and team skills in one command:

```bash theme={"system"}
npx portkey
```

<CardGroup cols={2}>
  <Card title="Claude Code setup" icon="terminal" href="/integrations/libraries/claude-code">
    Anthropic direct, Bedrock, and Vertex AI
  </Card>

  <Card title="Codex setup" icon="code" href="/integrations/libraries/codex">
    Full `config.toml` reference and provider options
  </Card>
</CardGroup>

***

## Next steps

<CardGroup cols={3}>
  <Card title="Budget Policies" icon="dollar-sign" href="/product/enterprise-offering/budget-policies">
    Hard spend limits per team or developer
  </Card>

  <Card title="Model Catalog" icon="sparkles" href="/product/model-catalog">
    Centralized provider credentials and access controls
  </Card>

  <Card title="Configs" icon="gear" href="/product/ai-gateway/configs">
    Fallbacks, load balancing, and routing strategies
  </Card>

  <Card title="MCP Gateway" icon="plug" href="/product/mcp-gateway">
    Govern MCP tool access across your agent fleet
  </Card>

  <Card title="Observability" icon="chart-line" href="/product/observability">
    Logs, traces, and cost breakdowns for every session
  </Card>

  <Card title="Agent Skills" icon="wand-magic-sparkles" href="/guides/coding-agents/skills">
    Sync team coding standards to every developer's agent
  </Card>
</CardGroup>
