# AI coding agents

DirectInference is a drop-in endpoint, so coding assistants and CLIs work the same way your app does — point them at the base URL and key, keep your model ids.

## Point your agent at DirectInference

Cursor, Claude Code, and most agent frameworks let you override the API base URL and key — usually through environment variables or a settings field. Set them to your DI surface and the agent sends requests through DirectInference unchanged.

```bash
# Most OpenAI-compatible agents and CLIs read these:
export OPENAI_BASE_URL="https://app.directinference.com/di/v1"
export OPENAI_API_KEY="llm_live_..."

# Anthropic-compatible agents (e.g. Claude Code):
export ANTHROPIC_BASE_URL="https://app.directinference.com/di"
export ANTHROPIC_API_KEY="llm_live_..."
```

:::tip[Keep the model id the agent already uses]
Whatever model the tool defaults to is treated as intent and echoed back. You do not need to configure a DirectInference model name — there is only one model, and request handling is automatic.
:::

## Machine-readable docs

For assistants that read documentation directly, DirectInference publishes condensed, plain-text indexes of the API at the root of the public site. Point a coding agent at them to teach it the endpoint, request types, and effort contract in one fetch.

:::note[llms.txt]
`https://directinference.com/llms.txt` — a compact overview.

`https://directinference.com/llms-full.txt` — the expanded reference.
:::

## A migration an agent can do for you

Because the switch is purely a base-URL-and-key change with the model ids left intact, an agent can convert an existing OpenAI, Anthropic, or Gemini integration mechanically — find the client construction, change two values, done. The full manual walkthrough is in [Migrate to DirectInference](https://docs.directinference.com/migrate/).