{
 "schema_version": 1,
 "generated": "2026-10-23",
 "id": "berriai-litellm--run-coding-agents-on-any-model-via-gateway",
 "repo": "BerriAI/litellm",
 "repo_url": "https://github.com/BerriAI/litellm",
 "repo_slug": "berriai-litellm",
 "title": "Run Claude Code or Codex on any model through the gateway",
 "page_title": "How to run Claude Code or Codex on any model through the gateway with Litellm",
 "summary": "Start a coding agent in a local repo and route all its model calls through your AI Gateway.",
 "who": "A developer who wants a coding agent such as Claude Code or Codex to work on a repo while every model call is tracked by the team's gateway.",
 "problem": "Coding agents usually talk to one provider directly, which makes model choice, cost and logging hard to manage centrally.",
 "outcome": "An agent edits files in a local repo and returns a result, with each model call sent through the AI Gateway.",
 "steps": [
  "Install the SDK and the proxy with `uv add litellm`",
  "Install the agent's CLI, such as claude or codex, plus starlette and uvicorn",
  "Set LITELLM_PROXY_API_BASE and LITELLM_PROXY_API_KEY to your gateway address and key",
  "Call Litellm.agent with a Harness value, a sandbox.local path to the repo, and a litellm_proxy/ model name"
 ],
 "agent_prompt": "In the litellm repo at <path>, run litellm.agent with Harness.CLAUDE_CODE on the local repo at <repo_path> with the task 'Find why tests/test_router.py is flaky'. Expected output: the agent's text result, its cost, and a list of changed file paths. Verify that LITELLM_PROXY_API_BASE and LITELLM_PROXY_API_KEY are set before running.",
 "agents": [
  "claude-code",
  "codex"
 ],
 "difficulty": "Advanced",
 "time": "60 minutes",
 "basis": "readme",
 "caveat": "The README describes this as a Python SDK feature that needs the agent's own CLI installed, so the agent's file changes happen in the repo you pass in.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Python and the uv package manager installed",
  "API keys for the LLM providers you plan to call, such as OpenAI or Anthropic",
  "For the gateway use cases: a machine to run the proxy server on and a LiteLLM master key or virtual key for clients"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.7,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/berriai-litellm/run-coding-agents-on-any-model-via-gateway/",
 "md": "https://dedupedai.com/use-cases/berriai-litellm/run-coding-agents-on-any-model-via-gateway/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/berriai-litellm--run-coding-agents-on-any-model-via-gateway.json",
 "api_version": "v1"
}
