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.

Base URL
https://visnea-labs.com/v1
POST/v1/chat/completions
POST/v1/responses
GET/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
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!" }] }'
python
# 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.

Base URL
https://visnea-labs.com/v1/anthropic
POST/v1/anthropic/v1/messages
POST/v1/anthropic/v1/messages/count_tokens
GET/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
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!" }] }'
python
# 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.

Create a key in the dashboard: API → Keys. It's shown once — save it.

Tools

Claude Code

  1. Install Claude Code

    bash
    curl -fsSL https://claude.ai/install.sh | bash# ornpm install -g @anthropic-ai/claude-code
  2. Point 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=1

    ANTHROPIC_DEFAULT_HAIKU_MODEL is the fast model for background chores (titles, summaries). The last line adds Visnea's models to /model.

  3. 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"  }}
  4. 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

  1. Turn on developer mode

    Help → Troubleshooting → Enable Developer Mode. The app restarts with a Developer menu.

  2. 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   Bearer

    The x-api-key scheme works too — Visnea accepts the key in either header.

  3. 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

  1. Install the Codex CLI

    bash
    npm install -g @openai/codex
  2. Put the key in your environment

    bash
    export VISNEA_API_KEY="sk-visnea-…"

    Windows (PowerShell): $env:VISNEA_API_KEY = "sk-visnea-…"

  3. 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"
  4. Run it

    bash
    codex# or one-shotcodex exec "Hi! What can you do?"
  5. 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

  1. Install OpenCode

    bash
    curl -fsSL https://opencode.ai/install | bash# ornpm install -g opencode-ai
  2. Put the key in your environment

    bash
    export VISNEA_API_KEY="sk-visnea-…"

    Windows (PowerShell): $env:VISNEA_API_KEY = "sk-visnea-…"

  3. 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.

  4. Run it

    bash
    opencode

    Switch models with /models.

Grok CLI

  1. Install Grok CLI

    bash
    curl -fsSL https://raw.githubusercontent.com/superagent-ai/grok-cli/main/install.sh | bash
  2. Point 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.

  3. Run it

    bash
    grok# or one-shotgrok -p "Hi! What can you do?"

Hermes Agent

  1. Install Hermes Agent

    bash
    curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
  2. Put the key in your environment

    bash
    export VISNEA_API_KEY="sk-visnea-…"

    Windows (PowerShell): $env:VISNEA_API_KEY = "sk-visnea-…"

  3. 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_KEY
  4. Run it

    bash
    hermes

    Switch models with /model.

Cherry Studio

  1. Add a provider

    Settings → Model Provider → + Add: name Visnea, type OpenAI.

  2. Paste the key and the address

    text
    API Key       sk-visnea-…API Address   https://visnea-labs.com

    Cherry Studio appends /v1/chat/completions itself. For Claude, add a second provider of type Anthropic at …/v1/anthropic.

  3. 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.