REST API
No SDK required. SovereignEG's API is standard REST with JSON request/response bodies.
Base URL
https://sovereigneg.com/v1
Authentication
Include your API key in the Authorization header:
Authorization: Bearer sk-...
Chat completions
curl https://sovereigneg.com/v1/chat/completions \
-H "Authorization: Bearer sk-..." \
-H "Content-Type: application/json" \
-d '{
"model": "...",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is 2+2?"}
],
"temperature": 0.7,
"max_tokens": 100
}'Streaming with curl
Add -N to disable buffering and "stream": true in the body:
curl -N https://sovereigneg.com/v1/chat/completions \
-H "Authorization: Bearer sk-..." \
-H "Content-Type: application/json" \
-d '{
"model": "...",
"messages": [{"role": "user", "content": "Write a story"}],
"stream": true
}'List models
curl https://sovereigneg.com/v1/modelsNo authentication required.
Embeddings
curl https://sovereigneg.com/v1/embeddings \
-H "Authorization: Bearer sk-..." \
-H "Content-Type: application/json" \
-d '{
"model": "...",
"input": "Hello from Cairo!"
}'Response headers
Every response includes these headers:
| Header | Description |
|---|---|
X-Request-Id | Unique request ID for debugging |
X-RateLimit-Limit-Requests | Your RPM limit |
X-RateLimit-Remaining-Requests | Requests remaining |
Note: spending is enforced through your organization's EGP credit balance, not through a tokens-per-minute header. See Rate Limits and Error Codes.
HTTP status codes
See Error Codes for the full table including machine-readable
code values per status.
| Code | Meaning |
|---|---|
200 | Success |
201 | Created (e.g. new API key) |
400 | Bad request (invalid parameters) |
401 | Unauthorized (invalid or missing API key) |
402 | Quota / spend cap exhausted — top up or raise the cap |
403 | Forbidden (org suspended, model not on your plan, IP not allow-listed…) |
404 | Resource not found |
409 | Conflict (idempotency / uniqueness collision) |
422 | Schema validation failed |
429 | Rate limited (check Retry-After header) |
500 | Internal server error |
503 | Service unavailable (model temporarily down) |