# SDKs and other tools

> Use Vikey from the OpenAI SDK, the Anthropic SDK and any tool that lets you set a base URL.

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

**Python**

  ```python
  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="")
  ```
**Node.js**

  ```js
  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

**Python**

  ```python
  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)
  ```
**Node.js**

  ```js
  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

Many tools read these standard variables. If yours does, set:

```bash
# OpenAI-format tools
export OPENAI_BASE_URL=https://api.vikey.ai/v1
export OPENAI_API_KEY=YOUR_API_KEY

# Anthropic-format tools
export ANTHROPIC_BASE_URL=https://api.vikey.ai
export ANTHROPIC_AUTH_TOKEN=YOUR_API_KEY
```

Then choose a Vikey model id in that tool's settings.

Source: https://docs.vikey.ai/en/agents/other-tools/
