◈ Surdhar AI

SURDHAR AI / DEVELOPERS

One API. A simpler way to build.

Beta documentation for Surdhar AI's authenticated chat-completion endpoint. Availability is controlled by the administrator's private configuration. No guaranteed uptime, latency, or model access is promised during beta.

01 · Sign in

Verify your account before generating an API key.

02 · Create a key

Create and privately store the one-time secret in your dashboard.

03 · Call the API

Send requests server-to-server with a Bearer token.

POST /v1/chat.php

Make your first request

Run this from your backend or terminal. Never put secret keys in frontend JavaScript.

curl https://surdhar.com/v1/chat.php \
  -H "Authorization: Bearer YOUR_SURDHAR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"Hello Surdhar AI"}],"max_tokens":128}'

Response shape

{
  "id": "sur-ai-123",
  "object": "chat.completion",
  "model": "provider-model-id",
  "choices": [{"index": 0, "message": {"role": "assistant", "content": "Hello!"}}],
  "usage": {"prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0}
}

This is an illustrative format, not a live request. Token usage is returned as reported by the upstream provider.

Errors & limits

HTTPMeaning
400 / 413Invalid or oversized request
401Missing, invalid, or revoked key
405POST required
429Daily quota reached or another request pending
502Upstream model call failed
503Inference disabled or provider not configured

The beta API allows up to 20 text messages, up to 16 KB request body, and caps max output at 512 tokens. Request quotas depend on the administrator settings and may change.

Build responsibly

Store keys securely, revoke any leaked keys, handle errors and retries, and set provider spending caps. Paid billing and a public SLA are not available in this beta.

Open developer dashboard →