feat(ai-gw): v2 claude-code cli how to#5863
Open
jbaross wants to merge 3 commits into
Open
Conversation
7 tasks
Contributor
There was a problem hiding this comment.
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 \ |
✅ Deploy Preview for kongdeveloper ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #issue
Preview Links
https://deploy-preview-5863--kongdeveloper.netlify.app/ai-gateway/use-claude-code-with-ai-gateway-anthropic/
Checklist
descriptionentry in frontmatter.