Skip to main content

Step 1: Create an Account

Sign up at the ElkAPI Console. Once registered, you’ll need these two configuration values:
VariableValue
BASE_URLhttps://api.elkapi.com
API_KEYThe API token you create in the console

Step 2: Create an API Key

Go to Dashboard → API Tokens, click “Add Token”, and copy the generated key. Store it somewhere safe for future use.

Step 3: Make Your First Request

Replace API_KEY with the token you just created. The BASE_URL is https://api.elkapi.com.
from openai import OpenAI

client = OpenAI(
    base_url="https://api.elkapi.com/v1",
    api_key="API_KEY",
)

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

print(response.choices[0].message.content)

Using the Anthropic Protocol

If you’re using Claude Code, Cursor, or any Anthropic SDK-based tool, use the Anthropic-compatible endpoint:
import anthropic

client = anthropic.Anthropic(
    base_url="https://api.elkapi.com/anthropic",
    api_key="API_KEY",
)

message = client.messages.create(
    model="claude-opus-4-5-20251101",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}]
)

print(message.content[0].text)

What’s Next

Introduction

Learn about ElkAPI platform features

Pricing

Understand billing methods and the pricing model

Text Models

Learn how to call language model APIs

Use Cases

Setup guides for Claude Code, Cursor, and other tools