Skip to navigation

Quickstart

The Reka API serves Reka models and popular open models through one OpenAI-compatible endpoint. Any OpenAI SDK works after you change the base URL and the API key.

Get an API key

Sign in at developer.reka.ai and create an API key. Save it as REKA_API_KEY in your environment.

export REKA_API_KEY="your-api-key"

Keep your API key secure. Never expose it in client-side code or share it publicly.

Install the OpenAI SDK

pip install openai

Make your first request

Set the base URL to https://api.reka.ai/v1, pass your Reka key as the API key, and choose a model from the model list.

import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.reka.ai/v1",
api_key=os.environ["REKA_API_KEY"],
)
response = client.chat.completions.create(
model="reka-flash-3",
messages=[{"role": "user", "content": "Why is the sky blue?"}],
)
print(response.choices[0].message.content)

Send an image

Models that accept images take them as image_url content parts, in the same shape the OpenAI API uses.

response = client.chat.completions.create(
model="reka-edge-2603",
messages=[
{
"role": "user",
"content": [
{"type": "image_url", "image_url": {"url": "https://v0.docs.reka.ai/_images/000000245576.jpg"}},
{"type": "text", "text": "What animal is this? Answer briefly."},
],
}
],
)
print(response.choices[0].message.content)

Next steps