AMOGH AI API
OpenAI-compatible where practical: existing OpenAI SDKs work by changing the base URL to https://<api-domain>/v1 and using an AMOGH AI key.
Authentication
Create a key in Developer API and send it as Authorization: Bearer amg_…. Keys are shown once and stored only as a hash. Revoke a key at any time.
Endpoints
GET/v1/models
Models your plan can use.
POST/v1/chat/completions
Chat. Body: model, messages, stream, max_tokens, temperature. With stream: true the answer arrives as `data:` chunks ending with `data: [DONE]`.
POST/v1/embeddings
Vectors for text. Body: model (amogh-embed), input (string or array), encoding_format (float | base64).
POST/v1/files
Upload a file (multipart field "file"): PDF, DOCX, TXT, PNG, JPEG, WEBP.
GET/v1/usage
This month's requests and tokens against your plan.
Example
curl https://<api-domain>/v1/chat/completions \
-H "Authorization: Bearer amg_..." \
-H "Content-Type: application/json" \
-d '{"model":"amogh-14b","messages":[{"role":"user","content":"नमस्ते"}],"stream":false}'Limits and errors
- Each key has a requests-per-minute limit; over it you get
429withRetry-After. - Monthly requests and tokens follow your workspace plan; over it:
429 QUOTA_EXCEEDED. - A model outside your plan:
403. A model whose server is down:503 MODEL_UNAVAILABLE. - Errors are JSON:
{ "error": { "code": "…", "message": "…", "requestId": "…" } }.