Skip to content

docs(cookbooks): use OpenAI / non-Anthropic models via a gateway#4

Merged
vaderyang merged 1 commit into
mainfrom
docs/cookbook-openai
Jun 6, 2026
Merged

docs(cookbooks): use OpenAI / non-Anthropic models via a gateway#4
vaderyang merged 1 commit into
mainfrom
docs/cookbook-openai

Conversation

@vaderyang

Copy link
Copy Markdown
Contributor

What

Documents how to run the agent loop on OpenAI (and Azure/Bedrock/Gemini/vLLM/Ollama).

Key reality: the agent surfaces run Claude Code (claude), which speaks the Anthropic Messages API (/v1/messages). OpenAI's /v1/chat/completions is a different schema, so LITELLM_BASE_URL can't point straight at api.openai.com. The bridge is a proxy (LiteLLM) that exposes an Anthropic-format endpoint and translates to OpenAI.

Adds to docs/cookbooks/README.md:

  • an OpenAI / Azure / OpenAI-compatible row in the model-endpoint table
  • a "Using OpenAI (or any non-Anthropic) models" section: minimal litellm-config.yaml mapping claude-3-5-sonnet-20241022openai/gpt-4o, the run command, and the secrets pointing at the proxy (not OpenAI directly)
  • the why (schema mismatch) + that the same pattern covers Azure/Bedrock/Gemini/local models

Generic, no internal infra (leakage gate green).

🤖 Generated with Claude Code

The agent surfaces run Claude Code (`claude`), which speaks the Anthropic
Messages API (/v1/messages). OpenAI speaks /v1/chat/completions — a different
schema — so LITELLM_BASE_URL can't point straight at api.openai.com. Document
the bridge: a LiteLLM proxy that exposes an Anthropic-format endpoint and
translates to OpenAI (or Azure/Bedrock/Gemini/vLLM/Ollama). Adds an OpenAI row
to the model-endpoint table + a minimal litellm-config.yaml + run + secrets
example, and the why.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vaderyang
vaderyang merged commit 46337a0 into main Jun 6, 2026
2 checks passed
@vaderyang
vaderyang deleted the docs/cookbook-openai branch June 6, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant