Developer guide

Integrating the API

From your API key to your first request and response.

1. Create an API key

Log in, open API keys in the console, and create a key. Copy it when it appears; the full value is shown only once.

2. Check your balance

Requests are billed by input tokens. New accounts start at zero: verify a card on the console’s Overview to get 5 units of free credit in your account currency (EUR, USD, GBP, or CHF), without being charged. Send your first requests with it, then add more on the Billing page.

3. Send a request

Save your key in the UPRELIC_API_KEY environment variable, then use cURL or the Python SDK. Both examples ask two independent questions about the same message.

Request · cURL
curl https://api.uprelic.com/v1/systemone \
  -H "Authorization: Bearer $UPRELIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "strom-1.0.7",
    "state": "Our whole team is blocked. The app has been down since this morning.",
    "questions": {
      "team": {
        "type": "choice",
        "instructions": "Which team should handle this?",
        "criteria": {
          "engineering": "Outages and bugs",
          "billing": "Payments and invoices",
          "account": "Login and access"
        }
      },
      "urgent": {
        "type": "noul",
        "instructions": "This message needs urgent attention."
      }
    }
  }'
Response · illustrative
{
  "model": "strom-1.0.7",
  "answers": {
    "team": {
      "type": "choice",
      "choice": "engineering",
      "confidence": 0.83,
      "probabilities": {
        "engineering": 0.89,
        "billing": 0.07,
        "account": 0.04
      }
    },
    "urgent": { "type": "noul", "noul": 0.96 }
  },
  "usage": {
    "input_tokens": 283,
    "output_tokens": 2,
    "cached_input_tokens": 256,
    "cost": 0.000011886,
    "currency": "usd"
  },
  "metadata": { "server_processing_time_ms": 85 }
}

The example values show the response shape. Actual answers and token counts depend on the request and model.

The response includes input and output token counts in usage. Input tokens determine the cost charged to your prepaid balance.

Explore all fields, validation rules, and models in the API reference.