Loading...
Loading...
Developer Docs
Everything you need to integrate WHITE LIFE AI into your applications.
The WHITE LIFE AI API is a RESTful service. All requests must be made over HTTPS and responses are returned in JSON format.
https://api.whitelifeai.comTo get started, sign up for an account and generate your API key from the Account Settings page. Your key grants access to all endpoints within your plan's limits.
Authenticate every request by including your API key as a Bearer token in the Authorization header.
curl https://api.whitelifeai.com/v1/health \ -H "Authorization: Bearer wla_sk_your_api_key_here"
Keep your API key secret
Never expose your API key in client-side code, public repositories, or browser requests. If compromised, rotate it immediately from your account settings.
All keys are prefixed with wla_sk_ followed by 48 alphanumeric characters.
Generate new keys at any time. Old keys can be revoked instantly with zero downtime.
Core endpoints for interacting with the WHITE LIFE AI platform. All endpoints require authentication unless noted otherwise.
/v1/tasksSubmit an AI task for processing. The platform routes it to the optimal model based on task type, complexity, and your plan configuration.
Request Body
{
"type": "summarize",
"input": "Your text here...",
"options": {
"model": "auto",
"max_tokens": 1024,
"temperature": 0.7
}
}Response
{
"id": "tsk_abc123def456",
"status": "completed",
"model_used": "claude-3.5-sonnet",
"result": "Summary of the provided text...",
"usage": {
"input_tokens": 342,
"output_tokens": 128,
"credits_used": 4.7
},
"duration_ms": 1240,
"created_at": "2026-03-15T10:30:00Z"
}/v1/tasks/:idRetrieve the details and result of a previously submitted task by its ID.
Response
{
"id": "tsk_abc123def456",
"status": "completed",
"type": "summarize",
"model_used": "claude-3.5-sonnet",
"result": "Summary of the provided text...",
"usage": {
"input_tokens": 342,
"output_tokens": 128,
"credits_used": 4.7
},
"duration_ms": 1240,
"created_at": "2026-03-15T10:30:00Z",
"completed_at": "2026-03-15T10:30:01Z"
}/v1/modelsList all available AI models with their capabilities, pricing, and current availability status.
Response
{
"models": [
{
"id": "claude-3.5-sonnet",
"provider": "anthropic",
"max_tokens": 8192,
"cost_per_1k_tokens": 0.003,
"status": "available"
},
{
"id": "gpt-4-turbo",
"provider": "openai",
"max_tokens": 4096,
"cost_per_1k_tokens": 0.01,
"status": "available"
},
{
"id": "gemini-1.5-pro",
"provider": "google",
"max_tokens": 8192,
"cost_per_1k_tokens": 0.0025,
"status": "available"
},
{
"id": "deepseek-v3",
"provider": "deepseek",
"max_tokens": 4096,
"cost_per_1k_tokens": 0.001,
"status": "available"
}
]
}/v1/chat/completionsOpenAI-compatible chat completions endpoint. Drop-in replacement for existing integrations. Supports streaming via SSE.
Request Body
{
"model": "auto",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Explain quantum computing in 3 sentences."
}
],
"max_tokens": 256,
"temperature": 0.7,
"stream": false
}Response
{
"id": "chat_xyz789",
"object": "chat.completion",
"model": "claude-3.5-sonnet",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum computing harnesses quantum mechanical phenomena..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 28,
"completion_tokens": 64,
"total_tokens": 92,
"credits_used": 1.2
}
}WHITE LIFE AI routes tasks to the optimal model via our A10 Algorithm. You can also specify a model directly.
A10 Auto-Routing: Set "model": "auto" to let our A10 algorithm pick the best model for each request based on task type, cost, speed, and availability.
Rate limits are enforced per API key. When you exceed your limit, the API returns a 429 status code with a Retry-After header.
| Plan | Monthly Requests | Burst Rate | Concurrency |
|---|---|---|---|
| Gold | 1,000/mo | 10/min | 2 |
| Diamond | 10,000/mo | 60/min | 10 |
| Master | Unlimited | 300/min | 50 |
| Enterprise | Custom | Custom | Custom |
# Rate limit headers included in every response
X-RateLimit-Limit: 10000 X-RateLimit-Remaining: 9847 X-RateLimit-Reset: 1742169600
All errors return a consistent JSON body with error, message, and request_id fields.
{
"error": "rate_limited",
"message": "You have exceeded your plan's rate limit. Please retry after 30 seconds.",
"request_id": "req_abc123",
"retry_after": 30
}| Code | Name | Description | Solution |
|---|---|---|---|
| 400 | Bad Request | The request body is malformed or missing required fields. | Check your JSON payload and ensure all required fields are present. |
| 401 | Unauthorized | Missing or invalid API key in the Authorization header. | Include a valid Bearer token in the Authorization header. |
| 403 | Forbidden | Your API key does not have permission to access this resource. | Check your plan tier or contact support to upgrade permissions. |
| 404 | Not Found | The requested resource (task, model, etc.) does not exist. | Verify the resource ID and ensure it belongs to your account. |
| 429 | Rate Limited | You have exceeded your plan's rate limit. | Reduce request frequency or upgrade your plan for higher limits. |
| 500 | Internal Error | An unexpected error occurred on our servers. | Retry with exponential backoff. If persistent, contact support. |
| 503 | Service Unavailable | The service is temporarily unavailable (maintenance or overload). | Check the status page and retry after a few minutes. |
Official client libraries for popular languages. Install and start making API calls in minutes.
npm install @whitelifeai/sdkpip install whitelifeaiReceive real-time notifications when events occur. Configure webhook endpoints from your dashboard for task completions, billing events, and system alerts.
// Example webhook payload
{
"event": "task.completed",
"task_id": "tsk_abc123",
"status": "success",
"model_used": "claude-3.5-sonnet",
"duration_ms": 1240,
"timestamp": "2026-03-15T10:30:00Z"
}All webhook payloads are signed with HMAC-SHA256. Verify the X-Signature header to ensure authenticity.