One API key for every model you build with

Call leading language models through an OpenAI-compatible endpoint, and generate images, video, audio and 3D through one queue API. Same key, same wallet.

Keep the OpenAI SDK you already use. Only the base URL and the key change.

curl https://www.genspark.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $GENSPARK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5-5",
    "messages": [{"role": "user", "content": "Write a haiku about queues."}]
  }'
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["GENSPARK_API_KEY"],
    base_url="https://www.genspark.ai/api/v1",
)
r = client.chat.completions.create(
    model="claude-sonnet-5-5",
    messages=[{"role": "user", "content": "Write a haiku about queues."}],
)
print(r.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.GENSPARK_API_KEY,
  baseURL: "https://www.genspark.ai/api/v1",
});
const r = await client.chat.completions.create({
  model: "claude-sonnet-5-5",
  messages: [{ role: "user", content: "Write a haiku about queues." }],
});
console.log(r.choices[0].message.content);
# Submit, then poll the status_url from the 202 response.
curl -X POST https://www.genspark.ai/api/v1/queue/fal-ai/flux-3 \
  -H "Authorization: Bearer $GENSPARK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "A lighthouse at dawn, film photo"}'

What you can call

Text and media models behind one base URL.

Browse the full catalogue and prices in the API platform

Built for production

First call in three steps

  1. Fund the API wallet

    An organization admin adds funds to the API wallet.

  2. Create a key

    Open the API platform, create a key and copy the secret. It is shown once.

  3. Make a call

    Set the base URL and send your first request.

Base URLhttps://www.genspark.ai/api/v1

Works with the OpenAI SDKs and with clients that accept a custom OpenAI base URL, such as Cursor, Cline, ChatBox and GenOffice.

Questions

Who can use GensparkRouter?

It is rolling out to Genspark Team organizations. Members of an organization with the API platform switched on can create keys.

Does it work with the OpenAI SDK?

Yes. Chat Completions and Responses follow the OpenAI format. Set the base URL and use your Genspark key.

How is usage billed?

Text models are billed per token and media models per generation, at each model’s listed price. Charges come from your organization’s prepaid API wallet, which is separate from Genspark membership credits.

What can an API key access?

Only model calls. A key cannot reach any other Genspark product or the data in your Genspark account.

Am I charged for a media request that does not finish?

No. A request that fails, is refused by content moderation, times out, or is cancelled while queued is refunded.

Start building

Create a key in the API platform and make your first call.

Get API key