Skip to content

Getting started

Quickstart

Send your first chat-style request in a few steps.

1. Create an API key

In the console, open API Keys and create a key. Copy the secret when it is shown — it is displayed only once.

2. Store the key

bash
export MODELPORT_API_KEY="YOUR_API_KEY"

3. Send a request

bash
curl https://api.modelport.example/v1/chat/completions \
  -H "Authorization: Bearer $MODELPORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "modelport-demo/atlas-chat",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

4. Read the response

json
{
  "id": "req_demo_01",
  "model": "modelport-demo/atlas-chat",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The customer cannot reset their password..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "input_tokens": 182,
    "output_tokens": 41,
    "total_tokens": 223
  }
}

The usage object reports input and output tokens for the request. These values drive billing and appear in the console.