Documentation

Speka AI API reference — OpenAI-compatible

Speka speaks the OpenAI Chat Completions dialect. If you've used OpenAI, you already know how to use us — point your client (the OpenAI SDKs, LangChain, or any library with a configurable base URL) at our base URL and use any model id from the catalog.

What is Speka's AI API?

Speka is an OpenAI-compatible AI API that provides a single endpoint — https://speka.me/v1 — for accessing frontier AI models across chat, embeddings, and image generation. Developers using the OpenAI Python or Node SDK switch to Speka by changing base_url to https://speka.me/v1 and substituting a Speka API key. Request shapes, response shapes, streaming behavior, and error envelopes are identical to the OpenAI format. Authentication uses standard Bearer tokens created in the Speka dashboard.

Quickstart

Base URL:

base-url
https://speka.me/v1

Install the OpenAI SDK and make your first call:

quickstart.py
from openai import OpenAI

client = OpenAI(
    base_url="https://speka.me/v1",
    api_key="sk-speka-live-...",  # your Speka key
)

resp = client.chat.completions.create(
    model="meta/llama-3.1-8b-instruct",
    messages=[{"role": "user", "content": "Write a haiku about GPUs."}],
    stream=True,
)
for chunk in resp:
    print(chunk.choices[0].delta.content or "", end="")

Authentication

Pass your key in the Authorization header as a bearer token. Create and revoke keys in your dashboard. Keys are shown once — store them securely.

auth
Authorization: Bearer sk-speka-live-...

Chat completions

POST /v1/chat/completions — supports messages, temperature, max_tokens, tools, response_format and more.

chat.ts
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://speka.me/v1",
  apiKey: process.env.SPEKA_API_KEY, // sk-speka-live-...
});

const stream = await client.chat.completions.create({
  model: "mistralai/mistral-nemotron",
  messages: [{ role: "user", content: "Solve: 23 * 47" }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

Streaming

Set stream: true to receive server-sent events. We proxy the upstream stream directly, so time-to-first-token stays low.

Calling from a no-code or HTTP-request tool (n8n, Zapier, Make, Postman)? Use stream: false — those tools can't parse SSE and will show the raw data: chunks. With stream: false you get one JSON object and read the reply from choices[0].message.content.

Embeddings

POST /v1/embeddings returns vectors for retrieval and semantic search.

embeddings.sh
curl https://speka.me/v1/embeddings \
  -H "Authorization: Bearer sk-speka-live-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nvidia/nv-embedqa-e5-v5",
    "input": ["The quick brown fox"]
  }'

Image generation

POST /v1/images/generations with an image model id such as black-forest-labs/flux.1-dev returns generated images.

Errors & rate limits

Errors use the OpenAI envelope: { "error": { "message", "type", "code" } }. Common statuses:

  • 401Missing or invalid key.
  • 402Usage allowance exhausted — upgrade or add credits.
  • 429Rate limit exceeded — see the Retry-After header.
  • 5xxUpstream issue — we auto-retry across capacity.
FAQ

Frequently asked questions

Yes. Speka implements the same REST interface as the OpenAI Chat Completions API. Set base_url to https://speka.me/v1, pass your Speka API key, and any existing OpenAI SDK call — chat completions, embeddings, or image generation — works without modifying your code.
Sign up at speka.me and open your dashboard. Under API Keys, create a new key. Keys are shown only once on creation — copy it immediately and store it in an environment variable such as SPEKA_API_KEY. You can revoke and create replacement keys at any time from the dashboard.
Yes. Set stream: true in your request to receive server-sent events (SSE). Speka proxies the upstream stream directly, keeping time-to-first-token low. If you are using n8n, Zapier, Make, or Postman — tools that cannot parse SSE — set stream: false to receive a single JSON object and read the reply from choices[0].message.content.
Speka's model catalog spans reasoning and chat (Nemotron 3 Ultra 550B, Llama 3.3 70B, DeepSeek V4 Flash), text embeddings (NVIDIA NV-EmbedQA E5 v5), and image generation (Black Forest Labs FLUX.1 [dev]). Pass any model ID as the model parameter in your API request. Browse the full current list at speka.me/models.
Speka uses the OpenAI error envelope format: {"error": {"message": "...", "type": "...", "code": "..."}}. Status 401 means your API key is missing or invalid. Status 402 means your usage allowance is exhausted — upgrade your plan or add credits. Status 429 means you have hit a rate limit — read the Retry-After header for how many seconds to wait. Status 5xx indicates an upstream provider issue; Speka automatically retries across available capacity.
Yes. POST to /v1/embeddings with a supported model such as nvidia/nv-embedqa-e5-v5 and an input array. The response returns float vectors you can index in any vector database — Pinecone, Weaviate, Qdrant, or pgvector — for semantic search or retrieval-augmented generation (RAG) pipelines.