# CodeProxy Agent Guide

CodeProxy is an OpenAI-compatible gateway for coding agents. Use it when an agent needs one API endpoint for supported coding models.

## Connection contract

- Base URL: `https://codeproxy.dev/v1`
- Authentication: send `Authorization: Bearer $CODEPROXY_API_KEY` (create a key in the CodeProxy dashboard).
- API styles: OpenAI Responses API (`/responses`) and compatible Chat Completions (`/chat/completions`) where supported.
- Never hard-code or expose an API key in source control, prompts, logs, or client-side code.
- Model availability and pricing are live: consult `https://codeproxy.dev/model-pricing` before selecting a model.

## Minimal Responses request

```bash
curl https://codeproxy.dev/v1/responses \
  -H "Authorization: Bearer $CODEPROXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5.6-sol","input":"Inspect this repository and summarize its architecture."}'
```

## Configure an agent

Set the agent's provider base URL to `https://codeproxy.dev/v1`, use the API key above, and select a model listed on the pricing page. For OpenAI Codex CLI, use:

```toml
model_provider = "CodeProxy"
model = "gpt-5.6-sol"
model_reasoning_effort = "medium"
disable_response_storage = true

[model_providers.CodeProxy]
name = "CodeProxy"
base_url = "https://codeproxy.dev/v1"
wire_api = "responses"
requires_openai_auth = true
```

Save the key in `~/.codex/auth.json`:

```json
{"OPENAI_API_KEY":"your-codeproxy-api-key"}
```

## Agent behavior

1. Read the repository's local instructions (`AGENTS.md`, `README`, and package scripts) before editing.
2. Prefer small, reversible changes and run the project's tests or checks after edits.
3. Ask for confirmation before destructive operations, external deployments, or actions involving secrets.
4. Report the files changed, commands run, and any remaining uncertainty.

## Canonical references

- Human documentation: `https://codeproxy.dev/docs`
- Model list and pricing: `https://codeproxy.dev/model-pricing`
- Machine-readable discovery: `https://codeproxy.dev/llms.txt`
