Loading models
Loading models
Loading model
Loading model
Grok Imagine Image is good. These would like a word anyway.
xAI's image generation model, pairing Grok's prompt understanding with high-quality output. Aimed at detailed, creative images that follow the prompt closely.
Provider xAI
from openai import OpenAI
client = OpenAI(
base_url="https://api.x.ai/v1",
api_key="$XAI_API_KEY",
)
response = client.chat.completions.create(
model="grok-imagine-image",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.x.ai/v1",
apiKey: process.env.XAI_API_KEY,
});
const response = await client.chat.completions.create({
model: "grok-imagine-image",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);curl https://api.x.ai/v1/chat/completions \
-H "Authorization: Bearer $XAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-imagine-image","messages":[{"role":"user","content":"Hello!"}]}'Set XAI_API_KEY with your xAI API key from console.x.ai.
17 outputs · generated before accounting joined the chat