Quickstart
Docs · Get started

Quickstart

Make your first request in 60 seconds. Drop-in for the OpenAI, Anthropic, and Gemini SDKs: change one line and keep your existing code.

Get a key#

Sign in to the console and create an API key. Each key belongs to a workspace, so its usage and budget are that workspace's. You can revoke a key at any time. See API keys.

When you first sign in, you land in your personal space, which has a default workspace. Requests are paid from the wallet of the space the key belongs to, so add credits before your first call (Credits).

Swap base_url#

Where you create the OpenAI client, set base_url to https://api.lune.io/v1. The SDK version, request shape, and response shape stay the same.

diff
  from openai import OpenAI

  client = OpenAI(
      api_key=os.environ["OPENAI_API_KEY"],
    - base_url="https://api.openai.com/v1",
    + base_url="https://api.lune.io/v1",
  )

The Anthropic and Gemini SDKs work the same way. Point each SDK at its base URL below. Each SDK's native auth header works (Authorization: Bearer, x-api-key, or x-goog-api-key), and all three take the same sk- key.

SDKbase_urlEndpoint
OpenAIhttps://api.lune.io/v1/chat/completions · /embeddings · /images/generations · /responses
Anthropichttps://api.lune.io/v1/messages
Geminihttps://api.lune.io/v1beta/models/{model}:generateContent

First request#

Set API_KEY in your environment and send a request. The response has the same shape as OpenAI's.

bash
curl https://api.lune.io/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek/deepseek-v4-pro",
    "messages": [
      {"role": "user", "content": "Say hello in five words."}
    ]
  }'

Models use a vendor/slug id, for example deepseek/deepseek-v4-pro. Every id is listed on Models. For tags, see Endpoints & models.

Where to go next#