1) Endpoint + Auth
Base URL: https://api.hardcarrx.com
Endpoint: POST /v1/chat/completions
Auth: Authorization: Bearer hmpk_... or x-api-key: hmpk_... (your Hardcarrx API Key). No x-tenant-id required.
HARDCARRX QUICKSTART
Hardcarrx gives you one API endpoint for multi-provider LLM routing, caching, and memory. Authenticate with your Hardcarrx API Key, then choose one of two provider-key methods.
Base URL: https://api.hardcarrx.com
Endpoint: POST /v1/chat/completions
Auth: Authorization: Bearer hmpk_... or x-api-key: hmpk_... (your Hardcarrx API Key). No x-tenant-id required.
Hardcarrx supports two ways to call providers behind the same Hardcarrx API Key. The canonical request fields are provider and optional provider_key.
export HARDCARRX_API_KEY="hxv_your_workspace_api_key"
curl -X POST https://api.hardcarrx.com/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer $HARDCARRX_API_KEY" -d '{
"provider": "openai",
"model": "gpt-4.1-mini",
"messages": [
{"role": "user", "content": "Reply with exactly: openai docs live"}
]
}'Use this after connecting OpenAI in Dashboard → Providers. Send your Hardcarrx API Key, choose the provider, and Hardcarrx uses the stored workspace credential.
export HARDCARRX_API_KEY="hxv_your_workspace_api_key"
export OPENROUTER_API_KEY="your_provider_api_key"
curl -X POST https://api.hardcarrx.com/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer $HARDCARRX_API_KEY" -d '{
"provider": "openrouter",
"provider_key": "'"$OPENROUTER_API_KEY"'",
"model": "openai/gpt-4.1-mini",
"messages": [
{"role": "user", "content": "Reply with exactly: openrouter docs live"}
]
}'Use this when you want BYOK behavior for a single request instead of relying on a stored workspace credential. This flow still requires both your Hardcarrx API Key and the provider key. Do not use legacy fields like llm_provider or llm_api_key.
{
"id": "chatcmpl_abc123",
"object": "chat.completion",
"created": 1763090000,
"model": "gpt-4.1-mini-2025-04-14",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "1) Define success metrics..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 68,
"completion_tokens": 72,
"total_tokens": 140
}
}The response follows the OpenAI-style chat completion shape. Use Dashboard → Logs to inspect status, provider, model, latency, cache, memory, and request ID after traffic runs.
Workspace-scoped management flows use the /v1/workspaces route family.
GET /v1/workspaces POST /v1/workspaces GET /v1/workspaces/:workspace_id/keys POST /v1/workspaces/:workspace_id/keys POST /v1/workspaces/:workspace_id/keys/:key_id/revoke GET /v1/workspaces/:workspace_id/provider-keys POST /v1/workspaces/:workspace_id/provider-keys DELETE /v1/workspaces/:workspace_id/provider-keys/:provider GET /v1/billing/workspaces/:workspace_id/entitlements GET /v1/billing/workspaces/:workspace_id/context-quota-policy PUT /v1/billing/workspaces/:workspace_id/context-quota-policy
Use workspace IDs for management calls. The legacy project route family is retired.