Documentation

DEVELOPER QUICKSTART

Getting Started with Cortex Cloud AI

Cortex Cloud AI provides an OpenAI-compatible API endpoint with automatic semantic caching and multi-cloud GPU spot failover. You can replace your existing base URL in one line of code.

Bash / cURL
curl -X POST https://api.cortexcloud-ai.com/v1/chat/completions \
  -H "Authorization: Bearer $CORTEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "cortex-router-auto",
    "messages": [{"role": "user", "content": "Deploy cluster in us-east-1"}],
    "cortex_options": {
      "semantic_cache": true,
      "max_cost_per_m_tokens": 0.50
    }
  }'

Python SDK Integration

Install the official client via pip and start routing requests through Cortex's neural gateway:

pip install cortexcloud-ai

from cortexcloud import CortexClient

client = CortexClient(api_key="ctx_live_your_api_key")

# Auto-routes between Claude 3.5, GPT-4o, and Llama 3 with 90%+ prompt cache
response = client.chat.create(
    model="cortex-neural-auto",
    messages=[{"role": "user", "content": "Explain Kubernetes spot instance arbitrage"}],
    cache_policy="aggressive"
)

print(response.choices[0].message.content)
print(f"Latency: {response.cortex_telemetry.latency_ms}ms | Cost Saved: {response.cortex_telemetry.cost_saved_usd}")

Model Context Protocol (MCP) Setup

Connect Cursor, Windsurf, or Claude Code directly to your cloud clusters:

{
  "mcpServers": {
    "cortex-cloud-ai": {
      "url": "https://mcp.cortexcloud-ai.com/v1/sse",
      "headers": {
        "Authorization": "Bearer YOUR_CORTEX_TOKEN"
      }
    }
  }
}