Code Examples

Copy-paste ready.

cURL

curl -X POST https://api.aivorylabs.in/v1/chat \
  -H "Authorization: Bearer ax_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "groq/llama-3.3-70b-versatile",
    "messages": [
      {"role": "user", "content": "What is the meaning of life?"}
    ],
    "stream": false
  }'

Python

import requests

resp = requests.post(
    "https://api.aivorylabs.in/v1/chat",
    headers={
        "Authorization": "Bearer ax_live_YOUR_API_KEY",
    },
    json={
        "model": "groq/llama-3.3-70b-versatile",
        "messages": [
            {"role": "user", "content": "What is the meaning of life?"}
        ],
        "stream": False
    }
)

data = resp.json()
print(data["content"])

Node.js

const resp = await fetch("https://api.aivorylabs.in/v1/chat", {
  method: "POST",
  headers: {
    "Authorization": "Bearer ax_live_YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    model: "groq/llama-3.3-70b-versatile",
    messages: [
      { role: "user", content: "What is the meaning of life?" }
    ],
    stream: false
  })
});

const data = await resp.json();
console.log(data.content);