Get started
Quickstart
Create a project and a key, call the gateway, then publish your first endpoint.
1. Create a project
Sign in at www.scalaix.com/app, or create an account. If you sign up with an email and password, we email you a 6-digit verification code: enter it when asked, or later from the banner in the console (your account works in the meantime). Then create a project. Pick the slug carefully: it becomes the first part of every published URL (www.scalaix.com/<slug>/...) and can't be changed later. Slugs are 3 to 40 characters of lowercase letters, digits and hyphens, and some words are reserved (app, api, docs, v1, ...).
2. Create a key
Open Keys in the project and choose Create key. Leave the rules empty to use the project's settings, or narrow them now. The full key is shown once; copy it into your secrets manager. Scalaix stores only a hash.
export SCALAIX_API_KEY="sx_..."3. Call the gateway
The gateway speaks the OpenAI chat completions API, so any OpenAI client works with a different base URL.
import os
from openai import OpenAI
client = OpenAI(base_url="https://www.scalaix.com/v1", api_key=os.environ["SCALAIX_API_KEY"])
reply = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Write a haiku about rate limits."}],
)
print(reply.choices[0].message.content)Or with curl:
curl https://www.scalaix.com/v1/chat/completions \
-H "Authorization: Bearer $SCALAIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-4o-mini", "messages": [{"role": "user", "content": "Hello"}]}'Every response carries X-Scalaix-Request-Id, plus X-Scalaix-Model (the model that answered), X-Scalaix-Cache and X-Scalaix-Fallbacks.
4. Build an endpoint
- In the project, open Collections and create one, for example
support. - Add an endpoint
classify-ticket. Declare an input variableticketof type object withsubjectandbody. - Write the prompt:
Classify this ticket:\n{{ticket.subject}}\n\n{{ticket.body}}. - In the output builder, add
category(string, enum),priority(integer) andtags(array of string). - Fill in the test form and choose Run test. Adjust until the answer is right.
- Choose Publish and write a short changelog. This creates version 1.
5. Call your endpoint
curl https://www.scalaix.com/acme/support/classify-ticket \
-H "Authorization: Bearer $SCALAIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"inputs": {"ticket": {"subject": "Charged twice", "body": "My card was billed twice in March."}}}'{
"data": { "category": "billing", "priority": 4, "tags": ["refund"] },
"model": "gpt-4o-mini",
"version": 1,
"cached": false,
"usage": { "input_tokens": 312, "output_tokens": 41, "cost_usd": 0.00012 },
"request_id": "req_8f2c41d07a"
}The generated docs for the collection are at www.scalaix.com/<project>/<collection> while the project's docs are public.