GETTING STARTED01 / 07
Quickstart
Create an API key, choose an active model, and make your first request through the CoreSync OpenAI-compatible API
01
AUTHENTICATION
Create an API key
Generate a key in your CoreSync dashboard and keep it in an environment variable
export CORESYNC_API_KEY="sk_live_..."
02
MODEL DISCOVERY
Confirm an active model ID
Query the catalog first so production requests always use a currently active route
curl https://gt.coresyncapi.com/v1/models \
-H "Authorization: Bearer $CORESYNC_API_KEY"
GET
/v1/modelsReturns active model IDs available to your account03
CHAT COMPLETIONS
Make your first request
Use the same base URL and authentication pattern from your preferred stack
curl https://gt.coresyncapi.com/v1/chat/completions \
-H "Authorization: Bearer $CORESYNC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v3.2",
"messages": [
{"role": "user", "content": "Hello from CoreSync AI"}
]
}'
from openai import OpenAI
import os
client = OpenAI(
api_key=os.environ["CORESYNC_API_KEY"],
base_url="https://gt.coresyncapi.com/v1",
)
response = client.chat.completions.create(
model="deepseek-v3.2",
messages=[{"role": "user", "content": "Hello from CoreSync AI"}],
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.CORESYNC_API_KEY,
baseURL: "https://gt.coresyncapi.com/v1",
});
const response = await client.chat.completions.create({
model: "deepseek-v3.2",
messages: [{ role: "user", content: "Hello from CoreSync AI" }],
});
console.log(response.choices[0].message.content);
04
RESPONSE
Read the response
The generated message is returned with completion state and token usage
{
"id": "chatcmpl-abc123",
"choices": [{
"message": {
"role": "assistant",
"content": "Hello! How can I help?"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 8,
"total_tokens": 20
}
}
05
TROUBLESHOOTING
Resolve common errors
Use the status code to identify the fastest next action
401AuthenticationSend the complete bearer key
402Credit requiredAdd prepaid credit to the account
404Route not foundConfirm endpoint and active model ID
422Invalid requestValidate JSON, model, and messages
429Rate limitedRetry with bounded backoff
503Temporarily unavailableRetry with bounded backoff
06
KEEP BUILDING
Choose your next route
Move from the first request to the API surface you need