Visnea API
Connect your tools
Visnea speaks the two standard protocols — OpenAI and Anthropic. Agents, IDEs and chat clients connect by swapping the address and the key, no plugins or proxies.
OpenAI-compatible API
The address for the OpenAI SDKs and any client that asks for an “OpenAI-compatible endpoint”. Send the key as Authorization: Bearer.
https://visnea-labs.com/v1/v1/chat/completions/v1/responses/v1/models- Chat Completions — streaming (stream: true), tool calls and image input.
- Responses — the protocol Codex runs on.
- Model list: data holds the chat models for clients, models the whole priced catalog.
curl https://visnea-labs.com/v1/chat/completions \ -H "Authorization: Bearer $VISNEA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "google-gemini-3-1-pro", "stream": true, "messages": [{ "role": "user", "content": "Hi!" }] }'# pip install openaiimport osfrom openai import OpenAIclient = OpenAI( base_url="https://visnea-labs.com/v1", api_key=os.environ["VISNEA_API_KEY"],)stream = client.chat.completions.create( model="google-gemini-3-1-pro", messages=[{"role": "user", "content": "Hi! What can you do?"}], stream=True,)for chunk in stream: if chunk.choices: print(chunk.choices[0].delta.content or "", end="", flush=True)Anthropic-compatible API
The address for the Anthropic SDKs, Claude Code and Claude Desktop. Send the key as x-api-key or Authorization: Bearer, and anthropic-version as usual.
https://visnea-labs.com/v1/anthropic/v1/anthropic/v1/messages/v1/anthropic/v1/messages/count_tokens/v1/anthropic/v1/models- Messages — streaming, tools and prompt caching (cache_control).
- count_tokens — count tokens before you send.
- The Claude models in Anthropic's list format — clients fill their model pickers from it.
curl https://visnea-labs.com/v1/anthropic/v1/messages \ -H "x-api-key: $VISNEA_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "anthropic-claude-sonnet-4-6", "max_tokens": 1024, "messages": [{ "role": "user", "content": "Hi!" }] }'# pip install anthropicimport osimport anthropicclient = anthropic.Anthropic( base_url="https://visnea-labs.com/v1/anthropic", api_key=os.environ["VISNEA_API_KEY"],)message = client.messages.create( model="anthropic-claude-sonnet-4-6", max_tokens=1024, messages=[{"role": "user", "content": "Hi! What can you do?"}],)print(message.content[0].text)Which model works where
The protocol depends on the model: Claude answers on Anthropic Messages, OpenAI's newer models on Responses, the rest on Chat Completions. Each model's endpoints and tool support are listed in the dashboard under API → Models. Agents — Claude Code, Codex, OpenCode, Hermes, Grok CLI — need models with tools.
Tools
It's the same everywhere: the Visnea address, an sk-visnea-… key and a model id. In the dashboard, under API → Connect, these steps come pre-filled with your models.
Claude Code
Install Claude Code
bash curl -fsSL https://claude.ai/install.sh | bash# ornpm install -g @anthropic-ai/claude-codePoint it at Visnea
Claude Code speaks Anthropic Messages — only the address and the key change.
bash export ANTHROPIC_BASE_URL="https://visnea-labs.com/v1/anthropic"export ANTHROPIC_AUTH_TOKEN="sk-visnea-…"export ANTHROPIC_MODEL="anthropic-claude-sonnet-4-6"export ANTHROPIC_DEFAULT_HAIKU_MODEL="anthropic-claude-haiku-4-5"export CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1ANTHROPIC_DEFAULT_HAIKU_MODEL is the fast model for background chores (titles, summaries). The last line adds Visnea's models to /model.
Or once, in ~/.claude/settings.json
json { "env": { "ANTHROPIC_BASE_URL": "https://visnea-labs.com/v1/anthropic", "ANTHROPIC_AUTH_TOKEN": "sk-visnea-…", "ANTHROPIC_MODEL": "anthropic-claude-sonnet-4-6", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "anthropic-claude-haiku-4-5", "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1" }}Run it
bash claude# or one-shotclaude -p "Hi! What can you do?"/status shows the Visnea address. Calls show up under Usage within seconds.
Claude Desktop
Turn on developer mode
Help → Troubleshooting → Enable Developer Mode. The app restarts with a Developer menu.
Connect Visnea as a gateway
Developer → Configure Third-Party Inference… Under Connection set Inference provider to Gateway and fill in:
text Gateway base URL https://visnea-labs.com/v1/anthropicGateway API key sk-visnea-…Gateway auth scheme BearerThe x-api-key scheme works too — Visnea accepts the key in either header.
Apply
Apply Changes — the app relaunches. On the sign-in screen continue without an Anthropic account: Chat, Cowork and the Code tab now run through Visnea and bill your balance.
The app pulls the Claude models from Visnea on its own — anthropic-claude-sonnet-4-6, for example.
Codex: CLI and app
Install the Codex CLI
bash npm install -g @openai/codexPut the key in your environment
bash export VISNEA_API_KEY="sk-visnea-…"Windows (PowerShell):
$env:VISNEA_API_KEY = "sk-visnea-…"Add the provider to ~/.codex/config.toml
toml model = "openai-gpt-5-5"model_provider = "visnea"[model_providers.visnea]name = "Visnea"base_url = "https://visnea-labs.com/v1"env_key = "VISNEA_API_KEY"wire_api = "responses"Run it
bash codex# or one-shotcodex exec "Hi! What can you do?"The Codex app and the IDE extension
Both read the same ~/.codex/config.toml — restart them after editing.
bash # macOS: so the app can see the keylaunchctl setenv VISNEA_API_KEY "sk-visnea-…"Apps opened outside a terminal don't see variables from ~/.zshrc. On Windows add VISNEA_API_KEY under Environment Variables and restart the app.
OpenCode
Install OpenCode
bash curl -fsSL https://opencode.ai/install | bash# ornpm install -g opencode-aiPut the key in your environment
bash export VISNEA_API_KEY="sk-visnea-…"Windows (PowerShell):
$env:VISNEA_API_KEY = "sk-visnea-…"Add the provider to opencode.json
Project root, or globally at ~/.config/opencode/opencode.json.
json { "$schema": "https://opencode.ai/config.json", "provider": { "visnea": { "npm": "@ai-sdk/openai-compatible", "name": "Visnea", "options": { "baseURL": "https://visnea-labs.com/v1", "apiKey": "{env:VISNEA_API_KEY}" }, "models": { "google-gemini-3-1-pro": { "name": "Gemini 3.1 Pro" } } } }, "model": "visnea/google-gemini-3-1-pro"}Add the Claude models as a second provider: @ai-sdk/anthropic with …/v1/anthropic/v1.
Run it
bash opencodeSwitch models with /models.
Grok CLI
Install Grok CLI
bash curl -fsSL https://raw.githubusercontent.com/superagent-ai/grok-cli/main/install.sh | bashPoint it at Visnea
Grok CLI calls OpenAI-compatible Chat Completions — any model with tools fits.
bash export GROK_BASE_URL="https://visnea-labs.com/v1"export GROK_API_KEY="sk-visnea-…"export GROK_MODEL="google-gemini-3-1-pro"Add the lines to ~/.zshrc or ~/.bashrc to keep them.
Run it
bash grok# or one-shotgrok -p "Hi! What can you do?"
Hermes Agent
Install Hermes Agent
bash curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bashPut the key in your environment
bash export VISNEA_API_KEY="sk-visnea-…"Windows (PowerShell):
$env:VISNEA_API_KEY = "sk-visnea-…"Add Visnea to ~/.hermes/config.yaml
Or interactively: hermes model → Custom endpoint, then the address, key and model.
yaml model: default: google-gemini-3-1-pro provider: custom base_url: https://visnea-labs.com/v1 key_env: VISNEA_API_KEYRun it
bash hermesSwitch models with /model.
Cherry Studio
Add a provider
Settings → Model Provider → + Add: name Visnea, type OpenAI.
Paste the key and the address
text API Key sk-visnea-…API Address https://visnea-labs.comCherry Studio appends /v1/chat/completions itself. For Claude, add a second provider of type Anthropic at …/v1/anthropic.
Add the models
Manage → fetch the model list and press + next to the ones you need, google-gemini-3-1-pro for example. Check verifies the key.