API Reference
API Reference
Complete reference for the Oblien API. Use SDK or REST API to access all features.
Getting Started
1. Get API Credentials
- Go to Dashboard → Settings → API Credentials
- Click Create API Key
- Copy Client ID and Client Secret
Secret is shown only once. Never expose credentials in frontend code.
2. Make Your First Request
npm install oblienimport { OblienClient } from 'oblien';
import { OblienChat } from 'oblien/chat';
const client = new OblienClient({
clientId: process.env.OBLIEN_CLIENT_ID,
clientSecret: process.env.OBLIEN_CLIENT_SECRET
});
const chat = new OblienChat(client);
const session = await chat.createSession({
agentId: 'your-agent-id',
namespace: 'production',
endUserId: 'user-123'
});
console.log(session);const response = await fetch('https://api.oblien.com/ai/session/create', {
method: 'POST',
headers: {
'X-Client-ID': process.env.OBLIEN_CLIENT_ID,
'X-Client-Secret': process.env.OBLIEN_CLIENT_SECRET,
'Content-Type': 'application/json'
},
body: JSON.stringify({
agent_id: 'your-agent-id',
namespace: 'production',
end_user_id: 'user-123'
})
});
const session = await response.json();
console.log(session);curl -X POST https://api.oblien.com/ai/session/create \
-H "X-Client-ID: $OBLIEN_CLIENT_ID" \
-H "X-Client-Secret: $OBLIEN_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "your-agent-id",
"namespace": "production",
"end_user_id": "user-123"
}'Base URL
https://api.oblien.comAuthentication
All requests require headers:
X-Client-ID: your-client-id
X-Client-Secret: your-client-secretClient-side: Use session tokens instead (Bearer token).
Rate Limits
| Plan | Requests/min | Tokens/day |
|---|---|---|
| Free | 60 | 100K |
| Pro | 600 | 1M |
| Enterprise | Custom | Custom |
See Pricing for details.
Endpoints
Sessions
| Endpoint | Method | Description |
|---|---|---|
/ai/session/create | POST | Create chat session |
/ai/session/list | GET | List sessions |
/ai/session/:id | GET | Get session |
/ai/session/:id/history | GET | Get session history |
/ai/session/:id/token/create | POST | Create session token |
/ai/session/token/refresh | POST | Refresh token |
Chat
| Endpoint | Method | Description |
|---|---|---|
/ai/chat/send | POST | Send message |
/ai/chat/upload | POST | Upload files |
/ai/session/history | GET | Get history (client-side) |
/ai/session/prepare | POST | Prepare session |
Agents
| Endpoint | Method | Description |
|---|---|---|
/ai/agents | GET | List agents |
/ai/agents | POST | Create agent |
/ai/agents/:id | GET | Get agent |
/ai/agents/:id | PUT | Update agent |
/ai/agents/:id | DELETE | Delete agent |
/ai/agents/:id/settings | GET/PUT | Agent settings |
Sandbox
| Endpoint | Method | Description |
|---|---|---|
/sandbox | GET | List sandboxes |
/sandbox | POST | Create sandbox |
/sandbox/:id | GET | Get sandbox |
/sandbox/:id | DELETE | Delete sandbox |
/sandbox/:id/start | POST | Start sandbox |
/sandbox/:id/stop | POST | Stop sandbox |
/sandbox/:id/restart | POST | Restart sandbox |
/sandbox/:id/metrics | GET | Get metrics |
Search
| Endpoint | Method | Description |
|---|---|---|
/search | POST | Search web |
/search/extract | POST | Extract content |
/search/crawl | POST | Crawl website |
Credits
| Endpoint | Method | Description |
|---|---|---|
/credits/balance | GET | Get balance |
/credits/namespace-quota | GET/POST | Namespace quotas |
/credits/end-users/quota | GET/POST | End user quotas |
/credits/history | GET | Usage history |
/credits/pricing-info | GET | Get pricing |
Namespaces
| Endpoint | Method | Description |
|---|---|---|
/namespaces | GET | List namespaces |
/namespaces | POST | Create namespace |
/namespaces/:id | GET | Get namespace |
/namespaces/:id | DELETE | Delete namespace |
Icons
| Endpoint | Method | Description |
|---|---|---|
/icons/search | GET | Search icons |
/icons/resources | GET | Get resources |
Deploy
| Endpoint | Method | Description |
|---|---|---|
/deploy | GET | List deployments |
/deploy | POST | Create deployment |
/deploy/:id | GET | Get deployment |
/deploy/:id/logs | GET | Get logs |
Projects
| Endpoint | Method | Description |
|---|---|---|
/projects | GET | List projects |
/projects | POST | Create project |
/projects/:id | GET | Get project |
/projects/:id | PUT | Update project |
/projects/:id | DELETE | Delete project |
Response Format
Success:
{
"success": true,
"data": { ... }
}Error:
{
"success": false,
"error": "Error message"
}SDKs
| Language | Package | Status |
|---|---|---|
| Node.js | npm install oblien | ✅ Available |
| Python | pip install oblien | 🔜 Coming Soon |
| Go | go get oblien | 🔜 Coming Soon |
Next Steps
- SDK Setup - Full SDK documentation
- Sessions - Chat sessions and guests
- Credits - Billing and quotas
- Integration - Framework examples