Merged
Conversation
webpiratt
reviewed
Feb 23, 2026
| valueFrom: | ||
| secretKeyRef: | ||
| name: anthropic | ||
| name: ai-provider |
Collaborator
There was a problem hiding this comment.
Should I change anthropic token value?
Contributor
Author
There was a problem hiding this comment.
Yes, this should be the openRouter API key. Which is a different key from anthropic, it should start with sk-or.... instead of sk-ant
Collaborator
There was a problem hiding this comment.
@realpaaao Hi, please create https://openrouter.ai/ tokens for dev and prod and share with me
c4c6b27 to
d63cf75
Compare
d63cf75 to
97a6bdb
Compare
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.
Migrate AI client from Anthropic to OpenRouter + per-request model selection
Summary
modelfield to override the default model per messageANTHROPIC_*toAI_*env vars with sensible defaults (onlyAI_API_KEYis required)Changes
internal/ai/anthropic/client.go→internal/ai/client.go— rewrite client for OpenRouter-compatible API (headers, model fallback)internal/config/config.go— newAIConfigwithAI_API_KEY,AI_MODEL,AI_BASE_URL, etc.cmd/server/main.go— wire up new config fieldsinternal/service/agent/types.go— add optionalModelfield toSendMessageRequestinternal/service/agent/agent.go— passreq.Modelinto AI request (empty string falls back to configured default)internal/service/agent/{tools,prompt,memory}.go— update import paths fromai/anthropic→ai.env.example,deploy/*.yaml,README.md— updated env vars and docsMigration
Existing deployments need to replace env vars:
ANTHROPIC_API_KEY → AI_API_KEY (OpenRouter key)
ANTHROPIC_MODEL → AI_MODEL (has default)
Tested
modelfield) → 200, uses configured default"model": "google/gemini-2.5-pro") → 200, routes to Gemini"model": "fakeprovider/nonsense") → 500, clear validation error