API Documentation

OpenAI-compatible chat threads + SDUI SDK. Authenticate with an SDK API key from the cockpit.

Authentication

All public endpoints use Bearer authentication. Generate a key at /sdk-keys in the cockpit. Keys are scoped:

Authorization: Bearer oag_xxxxxxxxxxxxxxxxxxxxxxxxx

Chat API scope: chat

OpenAI Assistants-compatible threads, messages, runs.

POST/v1/threads
curl -X POST https://omra.pro/v1/threads \
  -H "Authorization: Bearer $OAG_KEY" \
  -H "Content-Type: application/json" \
  -d '{"metadata": {"user": "alice"}}'
GET/v1/threads/{thread_id}
POST/v1/threads/{thread_id}/messages
curl -X POST https://omra.pro/v1/threads/$TID/messages \
  -H "Authorization: Bearer $OAG_KEY" \
  -H "Content-Type: application/json" \
  -d '{"role": "user", "content": "Hello"}'
GET/v1/threads/{thread_id}/messages?limit=20&after=…
POST/v1/threads/{thread_id}/runs
curl -X POST https://omra.pro/v1/threads/$TID/runs \
  -H "Authorization: Bearer $OAG_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-4o-mini", "stream": false}'

SDUI SDK

Server-driven UI widgets: embed CRM deal lists, dashboards, forms into any site.

POST/v1/sdk/token
GET/v1/sdk/view/{service}/{view_name}scope: view
POST/v1/sdk/actionscope: action
Web Component
<script type="module" src="https://omra.pro/v1/sdk/sdui-embed.js"></script>

<cockpit-widget
  gateway="https://omra.pro"
  service="bitrix24"
  view="deals_list"
  auth-token="oag_xxxxxxxxxxxxx">
</cockpit-widget>

Errors & Rate Limits