Skip to content

feat(ai-gw): v2 claude-code cli how to#5863

Open
jbaross wants to merge 3 commits into
release/ai-gateway-2.0from
feat/aigw-v2-cli-claude-code
Open

feat(ai-gw): v2 claude-code cli how to#5863
jbaross wants to merge 3 commits into
release/ai-gateway-2.0from
feat/aigw-v2-cli-claude-code

Conversation

@jbaross

@jbaross jbaross commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #issue

Preview Links

https://deploy-preview-5863--kongdeveloper.netlify.app/ai-gateway/use-claude-code-with-ai-gateway-anthropic/

Checklist

  • Tested how-to docs. If not, note why here.
  • All pages contain metadata.
  • Any new docs link to existing docs.
  • All autogenerated instructions render correctly (API, decK, Konnect, Kong Manager).
  • Style guide (capitalized gateway entities, placeholder URLs) implemented correctly.
  • Every page has a description entry in frontmatter.
  • Add new pages to the product documentation index (if applicable).

@jbaross jbaross added this to the AI GW 2.0 release milestone Jul 7, 2026
Copilot AI review requested due to automatic review settings July 7, 2026 14:56
@jbaross jbaross requested a review from a team as a code owner July 7, 2026 14:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new v2 AI Gateway how-to that walks readers through proxying Claude Code traffic to Anthropic by configuring AI Gateway entities via the Konnect API.

Changes:

  • Introduces a new how-to page for routing Claude Code requests through AI Gateway using Anthropic.
  • Documents creation of an AI Provider and AI Model via {% konnect_api_request %} blocks.
  • Adds a verification section showing how to run Claude Code against the local proxy endpoint.

Comment on lines +24 to +28
tldr:
q: How do I run Claude CLI through {{site.ai_gateway}}?
a: Install Claude CLI, configure its API key helper, create a Gateway Service and Route, attach the AI Proxy plugin to forward requests to Claude, optionally enable file-log to inspect traffic, and point Claude CLI to the local proxy endpoint so all LLM requests pass through the {{site.ai_gateway}} for monitoring and control.

---
Comment on lines +50 to +51
- name: Authorization
value: Bearer $ANTHROPIC_API_KEY
payloads: false
statistics: true
targets:
- name: claude-opus-4-6
* `targets`: Specifies which upstream AI Provider model to route requests to. Here, `provider: generic-anthropic` references the AI Provider we created earlier, and `name: claude-opus-4-6` specifies which Anthropic model to call upstream.
* `config.logging`: Configures what gets logged. With `statistics: true`, usage metrics (tokens, latency, cost) are logged for monitoring and billing. With `payloads: false`, full request/response bodies are not logged for privacy.

## Verify traffic through Kong
Now, we can start a {{ site.claude_code }} session that points it to the local {{site.ai_gateway}} endpoint:

```sh
ANTHROPIC_BASE_URL=http://localhost:8000/anything \
@netlify

netlify Bot commented Jul 7, 2026

Copy link
Copy Markdown

Deploy Preview for kongdeveloper ready!

Name Link
🔨 Latest commit 6232e21
🔍 Latest deploy log https://app.netlify.com/projects/kongdeveloper/deploys/6a50bca4142a5500084e2740
😎 Deploy Preview https://deploy-preview-5863--kongdeveloper.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Guaris and others added 2 commits July 7, 2026 16:22
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants