Models
Call GET /v1/models to retrieve a live list with metadata. Most of these are free/scraped upstreams and can go down without notice — run a live check to see what's actually working right now.
API Documentation
All endpoints speak JSON. The /v1/ routes are OpenAI-compatible — drop in any client library without changes.
Send a list of messages and receive a completion. Supports blocking and streaming modes.
{
"model": "gpt-4o",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Hello, can you help me?" }
],
"max_tokens": 1024
}
{
"id": "chatcmpl-1718000000000",
"object": "chat.completion",
"created": 1718000000,
"model": "gpt-4o",
"choices": [{
"index": 0,
"message": { "role": "assistant", "content": "Of course! What do you need?" },
"finish_reason": "stop"
}],
"usage": { "prompt_tokens": 20, "completion_tokens": 9, "total_tokens": 29 }
}
Add "use_tool": true and the model may call its built-in tools (e.g. live weather). They run server-side, so you just get the final answer — no follow-up call needed. Off by default; other models ignore it. Executed calls are listed in x_tool_calls; when streaming, they arrive as x_tool events.
// request
{ "model": "gemini-3.8-flash", "use_tool": true,
"messages": [{ "role": "user", "content": "What's the weather in Harare right now?" }] }
// response (finish_reason is always "stop")
{
"choices": [{ "message": { "role": "assistant", "content": "It's 21.1°C in Harare…" }, "finish_reason": "stop" }],
"x_tool_calls": [{
"id": "call_3032623", "type": "function", "status": "completed",
"function": { "name": "get_weather", "arguments": "{\"city\":\"Harare\"}" },
"output": { "current": { "temperature_2m": 21.1 } }
}]
}
Add "stream": true to receive a server-sent events stream. Each event carries a delta.content fragment. Ends with data: [DONE].
data: {"choices":[{"delta":{"role":"assistant"},"finish_reason":null}]}
data: {"choices":[{"delta":{"content":"Hey! "},"finish_reason":null}]}
data: {"choices":[{"delta":{"content":"How can I help?"},"finish_reason":null}]}
data: {"choices":[{"delta":{},"finish_reason":"stop"}]}
data: [DONE]
const res = await fetch('https://grey-api.vercel.app/v1/chat/completions', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ model: 'gpt-4o', messages: [{ role: 'user', content: 'Hello!' }], stream: true })
});
const reader = res.body.getReader();
const decoder = new TextDecoder();
let buf = '';
while (true) {
const { done, value } = await reader.read();
if (done) break;
buf += decoder.decode(value, { stream: true });
const lines = buf.split('\n');
buf = lines.pop();
for (const line of lines) {
if (!line.startsWith('data:')) continue;
const payload = line.slice(5).trim();
if (!payload || payload === '[DONE]') continue;
const chunk = JSON.parse(payload);
const text = chunk.choices?.[0]?.delta?.content;
if (text) process.stdout.write(text);
}
}
Returns all enabled models and their metadata in the OpenAI models list format.
Original endpoint — fully supported alongside the v1 routes.
{
"model": "gpt-4o",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Hello, can you help me?" }
],
"options": { "max_tokens": 2000 }
}
{
"model": "gpt-4o",
"response": "Of course! What do you need?",
"response_type": "text",
"usage": { "prompt_tokens": 20, "completion_tokens": 9, "total_tokens": 29 }
}
Playground
Requests go directly to the live API.
Code Examples
Swap in your deployment URL where needed.
const res = await fetch('https://grey-api.vercel.app/v1/chat/completions', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'gpt-4o',
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'Hello, how are you?' }
]
})
});
const data = await res.json();
console.log(data.choices[0].message.content);