Developer documentation

Developer API for custom integrations

For developers: Build custom chat interfaces, integrate with your app, or connect to other tools. Simple REST API with streaming support. Non-developer? Use our no-code widget instead—no API needed. See how →

Base URL

https://api.obdal.ai/v1

Status

Operational

Auth

Bearer key + allowed origins

Version

v1 · SSE streaming

Quickstart

Three steps to ship a production-ready chat experience.

Generate a scoped key, lock down origins, and call the chat endpoint with streaming responses. The defaults keep your team safe while you move fast.

Create a scoped key

Issue an API key per app with allowed origins to control access.

Set allowed origins

Whitelist production and staging domains to prevent key leakage.

Send a chat request

Post a user message, optionally stream tokens, and log the session id.

curl example
curl -N https://obdal.ai/api/v1/chat \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Summarize today’s incidents",
    "stream": true
  }'
# SSE stream delivers tokens as they’re generated
JS streaming
// Minimal fetch with streaming
const res = await fetch('/api/v1/chat', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${'$'}API_KEY`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ message: 'Hey!', stream: true })
});
// Read chunks as they arrive
for await (const chunk of res.body) {
  console.log(new TextDecoder().decode(chunk));
}
Endpoints

A focused API surface that covers the full customer loop.

Keep responses streaming and track sessions without extra infrastructure. Everything ships with sensible defaults.

POST

/v1/chat

JSON

Send a user message and receive a streaming AI response tailored to your dataset. Sessions keep context across turns.

Request

{
  "message": "Summarize the outage playbook",
  "api_key": "your_api_key",
  "session_id": "sess_9Rna21",
  "stream": true
}

Response

event: message
data: {"content":"Hi there! I read through your playbook—here's the short version..."}

event: end
data: {"session_id":"sess_9Rna21"}
GET

/v1/usage

JSON

Monitor requests, token usage, and costs per app to keep your team cost-aware.

Request

GET /v1/usage?api_key=your_api_key&start_date=2024-01-01

Response

{
  "total_requests": 1842,
  "total_tokens": 421930,
  "total_cost": 12.45
}
GET

/v1/sessions

JSON

Retrieve chat sessions with message history and usage metadata for your app.

Request

GET /v1/sessions?api_key=your_api_key&include_all=true

Response

{
  "sessions": [
    {
      "session_id": "sess_9Rna21",
      "last_at": "2024-01-15T10:30:00Z",
      "total_tokens": 2430,
      "preview": "Hi there! I read through..."
    }
  ]
}

Security & Compliance

Enterprise-grade security with encryption at rest and in transit. Your data stays protected.

Data Privacy

You own your content. Delete files anytime for GDPR compliance. Control exactly where your widget appears. No lock-in, ever.

Secure Access

TLS encryption, allowed origins, and scoped API keys prevent unauthorized access to your data.

SOC 2 Infrastructure

Hosted on SOC 2 compliant infrastructure with transparent data retention and audit logging.

Ready to Build Your AI Chatbot?

Join thousands of businesses using Obdal to automate customer support.