Skip to main content

1. Get an API Key

Log in as a tenant admin, navigate to Open API from the profile menu, and create a new API key.

2. Make a Chat Request

curl -X POST https://api.ones1ght.com/api/openapi/v1/chat/completions \
  -H "Authorization: Bearer osk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "shopping-assistant",
    "messages": [
      {"role": "user", "content": "Recommend a dinner menu for tonight"}
    ],
    "stream": true
  }'

3. Parse the Response

SSE streaming format:
data: {"choices":[{"delta":{"content":"How"},"index":0}]}

data: {"choices":[{"delta":{"content":" about"},"index":0}]}

data: [DONE]