DocsQuick Start
Quick Start
Get started with GoesAI using OpenAI-compatible API in 3 minutes.
Base URL
All model calls go directly to the GoesAI API Endpoint. Keys created in the console work for all compatible interfaces.
https://api.goesai.com/v1Authentication
Use Bearer token in the Authorization header. Never expose Keys in frontend code, public repos or logs.
Authorization: Bearer sk-...cURL
Make a simple chat request:
bash
curl https://api.goesai.com/v1/chat/completions \
-H "Authorization: Bearer sk-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [{"role": "user", "content": "ping"}]
}'Python
Using the official OpenAI SDK (pip install openai):
python
from openai import OpenAI
client = OpenAI(
api_key="sk-YOUR_KEY",
base_url="https://api.goesai.com/v1",
)
response = client.chat.completions.create(
model="claude-sonnet-4-6",
messages=[{"role": "user", "content": "ping"}],
)
print(response.choices[0].message.content)Node.js
Using the official OpenAI SDK (npm install openai):
javascript
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "sk-YOUR_KEY",
baseURL: "https://api.goesai.com/v1",
});
const response = await client.chat.completions.create({
model: "claude-sonnet-4-6",
messages: [{ role: "user", content: "ping" }],
});
console.log(response.choices[0].message.content);Stream
Streaming returns tokens incrementally, ideal for chat. Just add the stream field in cURL:
bash
curl https://api.goesai.com/v1/chat/completions \
-H "Authorization: Bearer sk-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [{"role": "user", "content": "hello"}],
"stream": true
}'Error Codes
Common error codes and troubleshooting:
401 Unauthorized -> Invalid or expired Key, check Key status in console
403 Forbidden -> Key does not have access to this model
429 Too Many Requests -> Rate limit exceeded, reduce concurrency or contact support
500 Internal Error -> Model service error, check status page
502/503 -> Gateway or model service temporarily unavailable, retry laterModel List
List all available models:
bash
curl https://api.goesai.com/v1/models \
-H "Authorization: Bearer sk-YOUR_KEY"