OpenAI-compatible API for sovereign AI
All API requests require a Bearer token in the Authorization header:
Authorization: Bearer <your-api-key>Generate API keys from your dashboard. Keys are shown only once at creation — store them securely.
https://api.au.yarn.prosodylabs.com.auPOST /v1/chat/completions
Send a list of messages and receive a model-generated response. Supports streaming via "stream": true.
{
"model": "mistralai/Mistral-7B-Instruct-v0.2",
"messages": [
{"role": "user", "content": "What is data sovereignty?"}
],
"stream": false
}Response follows the standard OpenAI chat completion format.
GET /v1/models
Returns a list of available models, including sovereignty information for each model.
Yarn provides two categories of model, each with different data handling:
Open-weight models running on Australian hardware. Your prompts and responses are processed entirely within Australia and never leave the country. Examples: Mistral 7B, Llama.
Frontier models accessed via overseas providers (OpenAI, Anthropic). Your prompts are sent to the provider's servers outside Australia. Examples: GPT-4o, Claude.
Each model response includes a sovereignty field indicating whether the model is sovereign or global.
curl -X POST https://api.au.yarn.prosodylabs.com.au/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mistralai/Mistral-7B-Instruct-v0.2",
"messages": [{"role": "user", "content": "Hello"}]
}'from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.au.yarn.prosodylabs.com.au/v1"
)
response = client.chat.completions.create(
model="mistralai/Mistral-7B-Instruct-v0.2",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'YOUR_API_KEY',
baseURL: 'https://api.au.yarn.prosodylabs.com.au/v1',
});
const response = await client.chat.completions.create({
model: 'mistralai/Mistral-7B-Instruct-v0.2',
messages: [{ role: 'user', content: 'Hello' }],
});stream = client.chat.completions.create(
model="mistralai/Mistral-7B-Instruct-v0.2",
messages=[{"role": "user", "content": "Explain data sovereignty"}],
stream=True
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")API requests are rate-limited per API key. Current limits are returned in the response headers:
X-RateLimit-Limit — maximum requests per windowX-RateLimit-Remaining — remaining requests in the current windowRateLimit-Reset — seconds until the window resetsIf you need higher limits, contact jordan@prosodylabs.com.au.
Yarn is built for Australian data residency. When you use a sovereign model, your data is processed on GPU hardware in Perth, Western Australia. It never leaves Australian infrastructure.
When you use a global model (GPT-4o, Claude, etc.), your prompt is proxied to the provider's API servers, which are located outside Australia. Responses are returned to you via Yarn but the prompt content transits through the provider's infrastructure.
Check the sovereignty field in the model response or the GET /v1/models endpoint before sending sensitive data. For full details, see our Privacy Policy.