CTS Router Quickstart
CTS Model Router provides an OpenAI-compatible API interface. You can use standard official client libraries by pointing the base URL to our gateway.
1. Obtain an API Key
Section titled “1. Obtain an API Key”Generate an API key from the CTS Router Developer Console. Store your key in an environment variable:
export CTS_API_KEY="cts_live_..."2. Make Your First Request
Section titled “2. Make Your First Request”curl -X POST https://api.creativetechstudios.org/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $CTS_API_KEY" \ -d '{ "model": "deepseek-r1-distill", "messages": [ {"role": "system", "content": "You are a concise technical assistant."}, {"role": "user", "content": "Explain the difference between on-device and edge routing."} ], "temperature": 0.2 }'from openai import OpenAIimport os
client = OpenAI( api_key=os.environ.get("CTS_API_KEY"), base_url="https://api.creativetechstudios.org/v1")
response = client.chat.completions.create( model="deepseek-r1-distill", messages=[ {"role": "system", "content": "You are a concise technical assistant."}, {"role": "user", "content": "Explain the difference between on-device and edge routing."} ], temperature=0.2)
print(response.choices[0].message.content)import OpenAI from 'openai';
const client = new OpenAI({ apiKey: process.env.CTS_API_KEY, baseURL: 'https://api.creativetechstudios.org/v1',});
async function main() { const completion = await client.chat.completions.create({ model: 'deepseek-r1-distill', messages: [ { role: 'system', content: 'You are a concise technical assistant.' }, { role: 'user', content: 'Explain the difference between on-device and edge routing.' }, ], temperature: 0.2, });
console.log(completion.choices[0].message.content);}
main();3. Streaming Responses
Section titled “3. Streaming Responses”To stream tokens in real-time with sub-second time-to-first-token (TTFT), pass "stream": true:
stream = client.chat.completions.create( model="claude-3-7-sonnet", messages=[{"role": "user", "content": "Synthesize a 3-point edge deployment strategy."}], stream=True)
for chunk in stream: if chunk.choices[0].delta.content is not None: print(chunk.choices[0].delta.content, end="", flush=True)