Assisters API

Migrating from OpenAI

Switch from OpenAI to Assisters API in minutes

Migrating from OpenAI

TL;DR

3 changes to migrate: 1) Base URL → api.assisters.dev/v1, 2) API key → your ask_ key, 3) Model → assisters-chat-v1. Same SDKs, same code structure, same response format. Migration takes under 5 minutes.

Assisters API is fully compatible with the OpenAI API specification. Migration typically takes just a few minutes.

Quick Migration

The only changes needed are:

  1. Base URL: Change to https://api.assisters.dev/v1
  2. API Key: Use your Assisters key (starts with ask_)
  3. Model Names: Update to Assisters model IDs
from openai import OpenAI

client = OpenAI(
    api_key="sk-..."  # OpenAI key
)

response = client.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "Hello!"}]
)
from openai import OpenAI

client = OpenAI(
    api_key="ask_...",  # Assisters key
    base_url="https://api.assisters.dev/v1"  # Add this line
)

response = client.chat.completions.create(
    model="assisters-chat-v1",  # Update model
    messages=[{"role": "user", "content": "Hello!"}]
)

Model Mapping

OpenAI ModelAssisters EquivalentNotes
gpt-4 / gpt-4-turboassisters-chat-v1Advanced reasoning
gpt-4oassisters-vision-v1Vision capabilities
gpt-3.5-turboassisters-chat-v1General chat
text-embedding-ada-002assisters-embed-v1Text embeddings
text-embedding-3-largeassisters-embed-v11024 dimensions
text-moderation-latestassisters-moderation-v1Content safety
whisper-1assisters-whisper-v1Speech-to-text
tts-1assisters-tts-v1Text-to-speech
dall-e-3assisters-image-v1Image generation

Environment Variables

Update your environment configuration:

# Before
OPENAI_API_KEY=sk-...

# After
ASSISTERS_API_KEY=ask_...
ASSISTERS_BASE_URL=https://api.assisters.dev/v1

SDK Configuration

Python

import os
from openai import OpenAI

# Option 1: Direct configuration
client = OpenAI(
    api_key=os.environ["ASSISTERS_API_KEY"],
    base_url="https://api.assisters.dev/v1"
)

# Option 2: Environment variables
# Set OPENAI_API_KEY and OPENAI_BASE_URL in your environment
client = OpenAI()  # Picks up from environment

JavaScript/TypeScript

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env.ASSISTERS_API_KEY,
  baseURL: 'https://api.assisters.dev/v1'
});

cURL

# Before
curl https://api.openai.com/v1/chat/completions \
  -H "Authorization: Bearer sk-..."

# After
curl https://api.assisters.dev/v1/chat/completions \
  -H "Authorization: Bearer ask_..."

Feature Compatibility

Fully Supported

FeatureStatus
Chat Completions✅ Full support
Streaming✅ Full support
Embeddings✅ Full support
Moderations✅ Full support
Vision (Images in chat)✅ Full support
Audio Transcription✅ Full support
Text-to-Speech✅ Full support
Image Generation✅ Full support
Models List✅ Full support

Coming Soon

FeatureStatus
Function CallingComing soon
Assistants APIUse chat API with context
Fine-tuningContact us

Response Format

Responses follow the exact OpenAI format:

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1706745600,
  "model": "assisters-chat-v1",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 15,
    "total_tokens": 25
  }
}

Migration Checklist

Sign up at assisters.dev and get your API key

Add base_url="https://api.assisters.dev/v1" to your client

Replace your OpenAI key with your Assisters key

Update model names to Assisters equivalents

Run your existing tests to verify compatibility

Check your dashboard for usage and any errors

Common Migration Issues

Gradual Migration

For production systems, consider a gradual rollout:

import os
import random

def get_client():
    # Gradually shift traffic
    if random.random() < float(os.environ.get("ASSISTERS_TRAFFIC", "0.1")):
        return OpenAI(
            api_key=os.environ["ASSISTERS_API_KEY"],
            base_url="https://api.assisters.dev/v1"
        )
    else:
        return OpenAI(api_key=os.environ["OPENAI_API_KEY"])

Calculate Your Savings

Use our pricing calculator to estimate your cost savings