Quickstart
Get up and running with the SovereignEG API in under a minute.
1. Get your API key
Sign up at /signup and create an API key in the dashboard. New accounts start on the free trial tier — top up with EGP credits from the dashboard once you're ready to scale beyond the trial limits.
2. Install the SDK
Use any OpenAI-compatible SDK:
pip install openai # Works out of the boxnpm install openai # Same — just change base_url3. Make your first request
Python
from openai import OpenAI
client = OpenAI(
api_key="sk-...",
base_url="https://sovereigneg.com/v1"
)
response = client.chat.completions.create(
model="...",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of Egypt?"}
]
)
print(response.choices[0].message.content)Node.js
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'sk-...',
baseURL: 'https://sovereigneg.com/v1',
});
const response = await client.chat.completions.create({
model: '...',
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'What is the capital of Egypt?' }
]
});
console.log(response.choices[0].message.content);curl
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 the capital of Egypt?"}
]
}'4. Try Arabic
Pick any live Arabic-capable chat model from the Model Library, then set an Arabic system prompt:
response = client.chat.completions.create(
model="...", # live model id from /v1/models or the Model Library
messages=[
{"role": "system", "content": "أنت مساعد ذكي يتحدث العربية بطلاقة."},
{"role": "user", "content": "اكتب مقدمة قصيرة عن مصر"}
]
)5. Stream the response
Add stream=True to get tokens in real time:
stream = client.chat.completions.create(
model="...",
messages=[{"role": "user", "content": "Explain quantum computing"}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")What's next
- Authentication — API keys, scopes, and security
- Chat Completions — full request and response reference
- Models Overview — browse all models with pricing
- Rate Limits — quotas, tiers, and how to handle 429s