Quickstart — first call in five minutes

1. Get your key

Ask your Organization Owner for an API key (portal → Developer → API keys), or create one yourself if you own the organization. Copy the sk-sf-… secret when it is shown — that happens once.

2. Say hello to a model

curl https://platform.senaiy.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-sf-..." \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-4o-mini", "messages": [{"role": "user", "content": "Hello!"}]}'

The same in Python, with the standard OpenAI SDK — only base_url changes:

from openai import OpenAI

client = OpenAI(base_url="https://platform.senaiy.ai/v1", api_key="sk-sf-...")

reply = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "مرحبا! ما هي عاصمة عمان؟"}],
)
print(reply.choices[0].message.content)

Arabic in, Arabic out — no special handling needed.

3. See what you can call

curl https://platform.senaiy.ai/v1/models -H "Authorization: Bearer sk-sf-..."

You get exactly the models on your key's allowlist, each badged cloud or local.

4. Run your first agent

An agent is configured in the portal (instructions, knowledge, tools) — your code just starts it and reads the result:

curl -X POST https://platform.senaiy.ai/v1/agents/{agent-id}/runs \
  -H "Authorization: Bearer sk-sf-..." \
  -d '{"input": "Summarize yesterday's new tickets"}'
# → {"message": {"run_id": "...", "status": "Queued"}}

curl https://platform.senaiy.ai/v1/runs/{run_id} -H "Authorization: Bearer sk-sf-..."

When the status is Completed, the output field holds the answer. If it says Waiting Approval, the agent wants to do something sensitive and a human must approve it in the portal first — that is the platform protecting you, not an error.

5. Watch the money

curl "https://platform.senaiy.ai/v1/usage" -H "Authorization: Bearer sk-sf-..."

Every request you just made is there, rated in USD. That is the whole billing model: a prepaid wallet, spent per call, visible per call.

Next: the Agents chapter for the full run/poll/steps pattern (with a ready Python helper class), or Workflows for multi-step processes.

Discard
Save
This page has been updated since your last edit. Your draft may contain outdated content. Load Latest Version

On this page

Review Changes ← Back to Content
Message Status Space Raised By Last update on