CloudPilot AI API Reference
CloudPilot AI provides an ultra-low latency inference proxy and autonomous cluster orchestration API. It is 100% wire-compatible with standard OpenAI and Anthropic SDK payload specifications, allowing zero-code refactoring drop-in integration.
1. Quickstart Guide
Install the official Python package or use standard HTTP requests with your API key:
pip install cloudpilot-sdk
2. Authentication
All API requests must contain your secret API key passed in the Authorization HTTP header as a Bearer token:
Authorization: Bearer cp_live_sec_your_api_key_here
/v1/chat/completions
Routes prompt to the target model cluster with automated sub-15ms semantic edge caching and intelligent token arbitrage.
curl -X POST https://api.cloudpilotai.org/v1/chat/completions \
-H "Authorization: Bearer cp_live_sec_99a8x" \
-H "Content-Type: application/json" \
-H "X-CloudPilot-Cache: enabled" \
-H "X-CloudPilot-Fallback: aws-us-east-1" \
-d '{
"model": "claude-3-5-sonnet-20241022",
"messages": [
{"role": "system", "content": "You are CloudPilot AI DevOps assistant."},
{"role": "user", "content": "Optimize GPU spot cluster allocation."}
],
"temperature": 0.2,
"stream": false
}'
{
"id": "cp_chat_89af1002x",
"object": "chat.completion",
"created": 1739884800,
"model": "claude-3-5-sonnet-20241022",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "GPU allocation strategy optimized for AWS spot instances."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 28,
"completion_tokens": 14,
"total_tokens": 42
},
"cloudpilot_telemetry": {
"cache_status": "HIT",
"cache_latency_ms": 3.8,
"total_latency_ms": 11.2,
"token_reduction_pct": 68.4,
"edge_node": "aws-use1-pop-04"
}
}
/v1/cluster/rebalance
Triggers autonomous GPU node reallocation, spot replacement, or multi-cloud hot standby failover.
3. Python SDK Usage
from cloudpilot import CloudPilotClient client = CloudPilotClient(api_key="cp_live_sec_99a8x") # Autonomous inference query response = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Cluster memory diagnosis"}] ) print(response.choices[0].message.content)