Make Your First API Call
Make sure you have obtained an API Key and configured your environment variables, then choose a method to get started.
- Python
- cURL
- Node.js
- Java
Install the SDK
pip install openai
Make a call
from openai import OpenAI
client = OpenAI(
api_key="your-api-key", # or use the environment variable TURING_API_KEY
base_url="https://live-turing.cn.llm.tcljd.com/api/v1",
)
response = client.chat.completions.create(
model="turing/gpt-5.4-mini",
messages=[
{"role": "user", "content": "Hello, please introduce yourself in one sentence."}
],
)
print(response.choices[0].message.content)
curl https://live-turing.cn.llm.tcljd.com/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-api-key" \
-d '{
"model": "turing/gpt-5.4-mini",
"messages": [
{"role": "user", "content": "Hello, please introduce yourself in one sentence."}
]
}'
Install the SDK
npm install openai
Make a call
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "your-api-key", // or use the environment variable TURING_API_KEY
baseURL: "https://live-turing.cn.llm.tcljd.com/api/v1",
});
const response = await client.chat.completions.create({
model: "turing/gpt-5.4-mini",
messages: [
{ role: "user", content: "Hello, please introduce yourself in one sentence." },
],
});
console.log(response.choices[0].message.content);
Add dependency (Maven)
<dependency>
<groupId>com.openai</groupId>
<artifactId>openai-java</artifactId>
<version>4.35.0</version>
</dependency>
Make a call
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.chat.completions.*;
OpenAIClient client = OpenAIOkHttpClient.builder()
.apiKey("your-api-key")
.baseUrl("https://live-turing.cn.llm.tcljd.com/api/v1")
.build();
ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
.model("turing/gpt-5.4-mini")
.addUserMessage("Hello, please introduce yourself in one sentence.")
.build();
ChatCompletion completion = client.chat().completions().create(params);
System.out.println(completion.choices().get(0).message().content().get());
Model Selection
The example uses turing/gpt-5.4-mini (best value for cost). You can browse the model list to select other models by provider, such as OpenAI, Claude, or Gemini.
Next Steps
- SDK Reference — Explore SDK features in depth
- Reasoning Model Configuration — Use reasoning models with stronger inference capabilities
- Model Selection Guide — Choose the most suitable model for your needs