Skip to main content

Quickstart: Call Your First Model API

This page walks you through your first model inference call in 5 minutes. The platform's public endpoints are compatible with the OpenAI API — if you have used the OpenAI SDK before, there is almost nothing new to learn.

Prerequisites

Step 1: Create an API key

  1. Go to Management > Keys.
  2. Click Add API Key and enter a key name; optionally set a Budget Limit.
  3. After clicking Create, copy the key immediately and store it safely.
caution

Once you close the creation panel, the full key can no longer be viewed. If you lose it, create a new key.

Step 2: Pick a model

  1. Go to Hub > Models Hub to browse all published models. You can filter by type or search by name and provider.
  2. Click a model card to view its Pricing and model information.
  3. Click API Endpoint; the panel shows code samples in Python, JavaScript, and cURL, along with the API path.

Step 3: Send your first request

Copy the code sample from the panel and replace your-api-key-here with the API key you created in Step 1. Using Python as an example:

from openai import OpenAI

client = OpenAI(
base_url="<API path shown in the panel>",
api_key="your-api-key-here", # replace with your API key
)

response = client.chat.completions.create(
model="<model name shown in the panel>",
messages=[{"role": "user", "content": "Introduce yourself in one sentence"}],
)
print(response.choices[0].message.content)

Once you run it and receive a reply from the model, you are done. Charges are based on token usage; you can review every call record at any time under Management > Usage.

Next steps