API Reference
Complete REST API documentation for Daily AI Agent OS. Base URL: https://api.dailyai.dev/v1
/auth/login) require a Bearer token or API key in the Authorization header: Authorization: Bearer sk-your-key
Run an Agent
Execute a specific agent with the provided parameters. Returns the generated signal or result. Execution is synchronous by default; pass "async": true for non-blocking runs.
Authentication
Requires a valid API key with agents:run scope.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Required | The agent identifier (e.g., trading, weather, seo) |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| asset | string | Required | Target asset ticker or identifier (e.g., "AAPL", "BTC-USD") |
| strategy | string | Required | Strategy to execute: momentum, mean_reversion, breakout, sentiment |
| timeframe | string | Optional | Analysis timeframe: 1m, 5m, 1h, 1d. Default: 1h |
| risk_level | string | Optional | Risk tolerance: low, medium, high. Default: medium |
| async | boolean | Optional | If true, returns a job ID for polling. Default: false |
Request Example
{
"asset": "AAPL",
"strategy": "momentum",
"timeframe": "1h",
"risk_level": "medium"
}
Response (200 OK)
{
"signal_id": "sig_abc123",
"agent_id": "trading",
"asset": "AAPL",
"strategy": "momentum",
"direction": "long",
"confidence": 0.87,
"entry_price": 198.45,
"stop_loss": 195.20,
"take_profit": 204.10,
"metadata": {
"indicators": ["RSI", "MACD", "EMA_20"],
"reasoning": "Strong momentum with RSI at 65 and MACD crossover"
},
"created_at": "2026-03-25T14:30:00Z"
}
Error Responses
| Status | Description |
|---|---|
| 400 | Invalid request body — missing required fields or invalid strategy |
| 401 | Unauthorized — missing or invalid API key |
| 404 | Agent not found — invalid agent ID |
| 429 | Rate limit exceeded — wait and retry |
| 500 | Internal server error — agent execution failed |
Code Examples
curl -X POST https://api.dailyai.dev/v1/agents/trading/run \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{
"asset": "AAPL",
"strategy": "momentum",
"timeframe": "1h"
}'
from dailyai import AgentOS
client = AgentOS(api_key="sk-your-key")
signal = client.agents.trading.run(
asset="AAPL",
strategy="momentum",
timeframe="1h"
)
print(signal)
const response = await fetch('https://api.dailyai.dev/v1/agents/trading/run', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk-your-key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
asset: 'AAPL',
strategy: 'momentum',
timeframe: '1h',
}),
});
const signal = await response.json();
console.log(signal);
List Agents
Returns a list of all available agents and their capabilities.
Authentication
Requires a valid API key with agents:read scope.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| category | string | Optional | Filter by category: trading, weather, content |
| status | string | Optional | Filter by status: active, beta, deprecated |
Response (200 OK)
{
"agents": [
{
"id": "trading",
"name": "Trading Signal Agent",
"category": "trading",
"description": "Generates buy/sell signals using technical and sentiment analysis",
"strategies": ["momentum", "mean_reversion", "breakout", "sentiment"],
"status": "active"
},
{
"id": "weather",
"name": "Weather Arbitrage Agent",
"category": "weather",
"description": "Identifies weather-driven market opportunities",
"strategies": ["commodity_impact", "energy_demand", "agriculture"],
"status": "active"
},
{
"id": "seo",
"name": "SEO Content Agent",
"category": "content",
"description": "Generates SEO-optimized content for target keywords",
"strategies": ["blog_post", "product_description", "meta_tags"],
"status": "active"
}
],
"total": 3
}
Error Responses
| Status | Description |
|---|---|
| 401 | Unauthorized — missing or invalid API key |
| 429 | Rate limit exceeded |
Code Examples
curl https://api.dailyai.dev/v1/agents \
-H "Authorization: Bearer sk-your-key"from dailyai import AgentOS
client = AgentOS(api_key="sk-your-key")
agents = client.agents.list()
for agent in agents:
print(f"{agent.id}: {agent.name}")const response = await fetch('https://api.dailyai.dev/v1/agents', {
headers: { 'Authorization': 'Bearer sk-your-key' },
});
const data = await response.json();
console.log(data.agents);List Signals
Retrieve a paginated list of signals generated by your agents.
Authentication
Requires a valid API key with signals:read scope.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| asset | string | Optional | Filter by asset ticker |
| strategy | string | Optional | Filter by strategy name |
| direction | string | Optional | long or short |
| min_confidence | number | Optional | Minimum confidence threshold (0.0 – 1.0) |
| limit | integer | Optional | Results per page (1–100). Default: 25 |
| offset | integer | Optional | Pagination offset. Default: 0 |
| since | string | Optional | ISO 8601 datetime — return signals after this time |
Response (200 OK)
{
"signals": [
{
"signal_id": "sig_abc123",
"agent_id": "trading",
"asset": "AAPL",
"strategy": "momentum",
"direction": "long",
"confidence": 0.87,
"entry_price": 198.45,
"created_at": "2026-03-25T14:30:00Z"
}
],
"total": 142,
"limit": 25,
"offset": 0,
"has_more": true
}
Error Responses
| Status | Description |
|---|---|
| 400 | Invalid query parameters |
| 401 | Unauthorized |
| 429 | Rate limit exceeded |
Code Examples
curl "https://api.dailyai.dev/v1/signals?asset=AAPL&min_confidence=0.8&limit=10" \
-H "Authorization: Bearer sk-your-key"signals = client.signals.list(
asset="AAPL",
min_confidence=0.8,
limit=10
)
for s in signals:
print(f"{s.direction} {s.asset} @ {s.confidence}")const url = new URL('https://api.dailyai.dev/v1/signals');
url.searchParams.set('asset', 'AAPL');
url.searchParams.set('min_confidence', '0.8');
const response = await fetch(url, {
headers: { 'Authorization': 'Bearer sk-your-key' },
});
const data = await response.json();
console.log(data.signals);Weather Signals
Retrieve weather-based trading signals. These signals identify market opportunities driven by weather patterns, including commodity impacts, energy demand shifts, and agricultural forecasts.
Authentication
Requires a valid API key with signals:read scope.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| region | string | Optional | Geographic region: us, eu, asia, global |
| commodity | string | Optional | Filter by commodity: natural_gas, wheat, corn, oil |
| severity | string | Optional | Weather event severity: low, medium, high, extreme |
| limit | integer | Optional | Results per page. Default: 25 |
Response (200 OK)
{
"signals": [
{
"signal_id": "wsig_def456",
"type": "weather_arbitrage",
"commodity": "natural_gas",
"region": "us",
"direction": "long",
"confidence": 0.92,
"weather_event": {
"type": "cold_snap",
"severity": "high",
"location": "Northeast US",
"forecast_date": "2026-03-28",
"temperature_deviation": -12.5
},
"expected_impact": "+8.3% price increase over 5 days",
"created_at": "2026-03-25T10:00:00Z"
}
],
"total": 7
}
Error Responses
| Status | Description |
|---|---|
| 401 | Unauthorized |
| 429 | Rate limit exceeded |
Code Examples
curl "https://api.dailyai.dev/v1/signals/weather?region=us&commodity=natural_gas" \
-H "Authorization: Bearer sk-your-key"weather_signals = client.signals.weather(
region="us",
commodity="natural_gas"
)
for ws in weather_signals:
print(f"{ws.commodity}: {ws.expected_impact}")const response = await fetch(
'https://api.dailyai.dev/v1/signals/weather?region=us',
{ headers: { 'Authorization': 'Bearer sk-your-key' } }
);
const data = await response.json();
console.log(data.signals);Login
Authenticate with email and password to receive a JWT access token. No API key required for this endpoint.
Authentication
None required.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| string | Required | Your account email address | |
| password | string | Required | Your account password |
Request Example
{
"email": "[email protected]",
"password": "your-password"
}
Response (200 OK)
{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"token_type": "bearer",
"expires_in": 3600,
"refresh_token": "rt_abc123def456"
}
Error Responses
| Status | Description |
|---|---|
| 400 | Missing email or password |
| 401 | Invalid credentials |
| 429 | Too many login attempts — account temporarily locked |
Code Examples
curl -X POST https://api.dailyai.dev/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "your-password"}'import requests
response = requests.post(
"https://api.dailyai.dev/v1/auth/login",
json={"email": "[email protected]", "password": "your-password"}
)
token = response.json()["access_token"]const response = await fetch('https://api.dailyai.dev/v1/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
email: '[email protected]',
password: 'your-password',
}),
});
const { access_token } = await response.json();Create API Key
Generate a new API key. Requires JWT authentication (use the /auth/login endpoint first).
Authentication
Requires a valid JWT access token (Bearer token from login).
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Required | A human-readable name for the key |
| scopes | string[] | Optional | Permission scopes. Default: all scopes. Options: agents:read, agents:run, signals:read, webhooks:manage |
| expires_in | integer | Optional | Expiry in seconds. Default: never expires |
Response (201 Created)
{
"key_id": "key_xyz789",
"api_key": "sk-live-abc123def456ghi789",
"name": "production-key",
"scopes": ["agents:read", "agents:run", "signals:read"],
"created_at": "2026-03-25T12:00:00Z",
"expires_at": null
}
api_key value is only returned once at creation time. Store it securely — you won't be able to retrieve it again.
Error Responses
| Status | Description |
|---|---|
| 400 | Missing key name or invalid scopes |
| 401 | Unauthorized — invalid or expired JWT |
| 409 | Key name already exists |
Code Examples
curl -X POST https://api.dailyai.dev/v1/auth/api-key \
-H "Authorization: Bearer eyJhbGciOi..." \
-H "Content-Type: application/json" \
-d '{"name": "production-key", "scopes": ["agents:run", "signals:read"]}'import requests
response = requests.post(
"https://api.dailyai.dev/v1/auth/api-key",
headers={"Authorization": f"Bearer {token}"},
json={
"name": "production-key",
"scopes": ["agents:run", "signals:read"]
}
)
api_key = response.json()["api_key"]
print(f"Save this key: {api_key}")const response = await fetch('https://api.dailyai.dev/v1/auth/api-key', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'production-key',
scopes: ['agents:run', 'signals:read'],
}),
});
const { api_key } = await response.json();WebSocket — Dashboard Stream
Real-time streaming connection for the dashboard. Receives live signal updates, agent status changes, and system notifications as they happen.
Authentication
Pass your API key as a query parameter: ?api_key=sk-your-key or in the first message after connection.
Connection
wss://api.dailyai.dev/ws/dashboard?api_key=sk-your-key
Message Types (Server → Client)
| Type | Description | Payload |
|---|---|---|
| signal.new | A new signal was generated | Full signal object |
| agent.status | Agent status changed (running, completed, error) | Agent ID + status |
| system.notification | System alert or maintenance notice | Message + severity |
| heartbeat | Keep-alive ping (every 30s) | Timestamp |
Example Messages
// signal.new
{
"type": "signal.new",
"data": {
"signal_id": "sig_realtime001",
"asset": "TSLA",
"direction": "short",
"confidence": 0.76,
"strategy": "mean_reversion"
},
"timestamp": "2026-03-25T15:45:12Z"
}
// agent.status
{
"type": "agent.status",
"data": {
"agent_id": "trading",
"status": "completed",
"run_id": "run_xyz789"
},
"timestamp": "2026-03-25T15:45:13Z"
}
// heartbeat
{
"type": "heartbeat",
"timestamp": "2026-03-25T15:45:30Z"
}
Client Messages
You can send subscription filters to receive only specific event types:
{
"action": "subscribe",
"channels": ["signal.new", "agent.status"],
"filters": {
"assets": ["AAPL", "TSLA", "BTC-USD"]
}
}
Code Examples
import asyncio
from dailyai import AgentOS
async def stream_dashboard():
client = AgentOS(api_key="sk-your-key")
async for event in client.dashboard.stream():
if event.type == "signal.new":
print(f"New signal: {event.data.asset} {event.data.direction}")
elif event.type == "agent.status":
print(f"Agent {event.data.agent_id}: {event.data.status}")
asyncio.run(stream_dashboard())const ws = new WebSocket('wss://api.dailyai.dev/ws/dashboard?api_key=sk-your-key');
ws.onopen = () => {
// Subscribe to specific channels
ws.send(JSON.stringify({
action: 'subscribe',
channels: ['signal.new', 'agent.status'],
}));
};
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
switch (msg.type) {
case 'signal.new':
console.log('New signal:', msg.data);
break;
case 'agent.status':
console.log('Agent status:', msg.data);
break;
}
};