Coding Agents
Coding agents can generate frequent model and tool requests or call official AI services from development environments. Route that traffic through AISIX when platform teams need governed access, policy, and telemetry for developer AI tools.
These guides cover coding tools that connect directly to AISIX and tools that retain their official service endpoints behind an operator-managed forward proxy. The client may run in a local editor, CLI, remote development environment, or automation job.
Why Route Coding Agents Through AISIX
A common rollout is for a platform team to make AISIX the approved gateway for developer AI tools. For direct integrations, developers configure Codex, Claude Code, Cline, Cursor, or another client with an AISIX proxy URL, caller API key, and custom model value instead of raw provider credentials. The custom model value is the AISIX model alias.
For a tool such as GitHub Copilot that keeps its official service endpoints, an operator-managed egress device can terminate TLS and deliver selected traffic to an AISIX passthrough route. The route resolves a dedicated caller-key principal. In the primary header_key configuration, the device presents a gateway credential; an anonymous route can instead bind the principal and restrict traffic by source CIDR. The client keeps its upstream credential, and the device can attach a trusted employee identity when configured.
In both patterns, the coding agent continues to use its native configuration and request format. AISIX enforces access, policy, and telemetry before relaying the selected traffic. Direct model and MCP paths use model or tool authorization. The forward-proxy path uses its caller-key principal and route grant; employee identity is recorded only when a trusted identity header is configured.
This setup is useful when teams want to:
- keep provider credentials out of directly configured editor and CLI clients.
- authenticate each developer, project, automation job, or shared tool profile with a caller API key, or bind forward-proxy traffic to a dedicated caller-key principal.
- use model aliases to control which upstream models a directly configured client can reach.
- enforce request limits and guardrails, record usage across supported coding-agent paths, and apply matching AISIX Cloud budgets to model calls, MCP tool calls, and passthrough requests attributed to a caller key.
- change the upstream provider or model behind an alias without asking users of direct integrations to reconfigure their tools.
Sensitive Code and Credentials
Coding agents may send source code, configuration snippets, stack traces, or terminal output as part of a task. That context can contain API keys, customer data, personal information, or internal identifiers.
Because AISIX sits between the coding agent and the upstream model, MCP server, or official service, teams can inspect and control that traffic at the gateway layer. On routes that support redaction write-back, use PII Detection and Redaction when sensitive values should be masked or blocked. Passthrough routes do not rewrite provider-native bodies, so configure a block action when matched content must not leave the network. Use Guardrails for broader request and response policy checks.
Choose a Client Guide
Start with the guide for the coding tool you want to route through AISIX:
| Client | Primary AISIX path | Guide |
|---|---|---|
| Codex | OpenAI Responses API | Codex |
| Claude Code | Anthropic Messages | Claude Code |
| Cline | OpenAI-compatible API | Cline |
| Cursor Ask mode | OpenAI-compatible API | Cursor |
| GitHub Copilot | Host-matched passthrough route through an egress proxy | Forward Proxy for IDE AI Traffic |
The direct-client guides assume that the AISIX gateway already has a model alias and caller API key for the route the client will use. In the client UI or config file, that alias may appear as a custom model, model ID, or model name. The GitHub Copilot guide lists its forward-proxy prerequisites separately.
For a direct integration, obtain the gateway URL, model alias, and caller API key from the team that manages AISIX. If AISIX is not yet deployed, follow the Open-Source AISIX Gateway Quickstart or AISIX Cloud Quickstart, or contact API7 for Hybrid Cloud access. The forward-proxy guide lists its egress, network, and route prerequisites separately.
How Coding Agents Use AISIX
Coding agents connect to AISIX through direct model and tool APIs or through a trusted forward proxy:
| Client path | AISIX route | Use when |
|---|---|---|
| Model requests | OpenAI-compatible routes for Chat Completions or Responses API, or Anthropic Messages | The agent should call models through an AISIX caller API key and model alias. |
| Tool requests | MCP Gateway at /mcp | The agent should discover and call upstream MCP tools through AISIX tool access control. |
| Forward-proxy requests | Host-matched passthrough route | The tool must keep its official service endpoint while an egress device sends selected traffic through AISIX. |
All three paths use AISIX as the boundary between the coding tool and the upstream service. Each client keeps its native request format. Direct integrations use an AISIX caller key and model or tool authorization. A forward-proxy integration resolves a caller-key principal from a device credential or source-restricted anonymous binding, then applies the route grant. Traffic controls and guardrails apply according to the selected route and caller-key principal. Observability can additionally include an employee identity supplied by the trusted device.
The direct model and tool paths look like this:
For MCP-specific governance, see MCP Gateway Overview. For the available proxy API families, see Supported Endpoints.
Next Steps
- Codex: route Codex Responses API traffic through AISIX.
- Claude Code: route Claude Code Anthropic Messages traffic through AISIX.
- Cline: route Cline OpenAI-compatible traffic through AISIX.
- Cursor: route Cursor Ask mode traffic through AISIX.
- Forward Proxy for IDE AI Traffic: route selected Copilot traffic through a trusted egress device and AISIX.
- MCP Gateway: connect coding agents to upstream MCP tools through AISIX.
- Supported Endpoints: review the caller-facing API families AISIX exposes.