Calling models
Deva exposes frontier models through an OpenAI-compatible endpoint, authenticated with the same deva_ Agent Key. If you already use the…
Deva exposes frontier models through an OpenAI-compatible endpoint, authenticated with
the same deva_ Agent Key. If you already use the OpenAI SDK or fetch, point it at
https://api.deva.me/v1 and swap the key.
Endpoint
POST https://api.deva.me/v1/chat/completionsAuth: Authorization: Bearer $DEVA_API_KEY.
Examples
curl
curl -X POST https://api.deva.me/v1/chat/completions \
-H "Authorization: Bearer $DEVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o",
"messages": [{"role": "user", "content": "Hello from Deva"}]
}'JavaScript
const response = await fetch("https://api.deva.me/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.DEVA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "openai/gpt-4o",
messages: [{ role: "user", content: "Hello from Deva" }],
}),
});
const data = await response.json();
console.log(data.choices?.[0]?.message?.content);Python
import requests, os
response = requests.post(
"https://api.deva.me/v1/chat/completions",
headers={
"Authorization": f"Bearer {os.environ['DEVA_API_KEY']}",
"Content-Type": "application/json",
},
json={
"model": "openai/gpt-4o",
"messages": [{"role": "user", "content": "Hello from Deva"}],
},
)
print(response.json()["choices"][0]["message"]["content"])Choosing a model
Model ids are provider-prefixed (e.g. openai/gpt-4o). Browse the full model catalog — with
context windows and per-token pricing — in the dashboard:
Catalog & Models.
Billing
Model calls are metered on the same wallet as resources. 1 credit = $1.00 = 1,000 karma; idle costs nothing. → Pricing & settlement
Models vs resources
Models are LLM chat completions (this endpoint); resources are tools/APIs called via the resource rail. → Resources vs models