SDKs and other tools
Any tool that lets you set a base URL and API key for OpenAI or Anthropic can use Vikey. The rule:
| Tool uses the format | Base URL | Example models |
|---|---|---|
| OpenAI | https://api.vikey.ai/v1 |
openai/gpt-6.1-sol, vikey/agent-gpt |
| Anthropic | https://api.vikey.ai |
anthropic/claude-sonnet-5.5, vikey/agent-coding |
Models from any provider work through both formats. For example, GPT models work through the Anthropic SDK, and Claude models through the OpenAI SDK.
OpenAI SDK
Section titled “OpenAI SDK”from openai import OpenAI
client = OpenAI(base_url="https://api.vikey.ai/v1", api_key="YOUR_API_KEY")
stream = client.chat.completions.create( model="anthropic/claude-sonnet-5.5", messages=[{"role": "user", "content": "Explain recursion in two sentences."}], stream=True,)for chunk in stream: print(chunk.choices[0].delta.content or "", end="")import OpenAI from 'openai'
const client = new OpenAI({ baseURL: 'https://api.vikey.ai/v1', apiKey: 'YOUR_API_KEY' })
const stream = await client.chat.completions.create({ model: 'anthropic/claude-sonnet-5.5', messages: [{ role: 'user', content: 'Explain recursion in two sentences.' }], stream: true,})for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content || '')Anthropic SDK
Section titled “Anthropic SDK”import anthropic
client = anthropic.Anthropic(base_url="https://api.vikey.ai", api_key="YOUR_API_KEY")
message = client.messages.create( model="anthropic/claude-sonnet-5.5", max_tokens=1024, messages=[{"role": "user", "content": "Explain recursion in two sentences."}],)print(message.content[0].text)import Anthropic from '@anthropic-ai/sdk'
const client = new Anthropic({ baseURL: 'https://api.vikey.ai', apiKey: 'YOUR_API_KEY' })
const message = await client.messages.create({ model: 'anthropic/claude-sonnet-5.5', max_tokens: 1024, messages: [{ role: 'user', content: 'Explain recursion in two sentences.' }],})console.log(message.content[0].text)Through environment variables
Section titled “Through environment variables”Many tools read these standard variables. If yours does, set:
# OpenAI-format toolsexport OPENAI_BASE_URL=https://api.vikey.ai/v1export OPENAI_API_KEY=YOUR_API_KEY
# Anthropic-format toolsexport ANTHROPIC_BASE_URL=https://api.vikey.aiexport ANTHROPIC_AUTH_TOKEN=YOUR_API_KEYThen choose a Vikey model id in that tool’s settings.