Quickstart
Get from sign-up to your first API call in three steps.
Three steps from sign-up to first call
Make your first call
OpenAI Chat Completions
curl https://api.thegrid.ai/v1/chat/completions \
-H "Authorization: Bearer YOUR_GRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "text-prime",
"messages": [
{"role": "user", "content": "What is a spot market for AI inference?"}
]
}'from openai import OpenAI
client = OpenAI(base_url="https://api.thegrid.ai/v1", api_key="YOUR_GRID_API_KEY")
response = client.chat.completions.create(
model="text-prime",
messages=[{"role": "user", "content": "What is a spot market for AI inference?"}],
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.thegrid.ai/v1",
apiKey: "YOUR_GRID_API_KEY",
});
const response = await client.chat.completions.create({
model: "text-prime",
messages: [
{ role: "user", content: "What is a spot market for AI inference?" },
],
});
console.log(response.choices[0].message.content);Anthropic Messages (beta)
What to do next
Last updated
Was this helpful?