Theme
Online API Testing
Online API testing helps you verify your API key, base URL, model ID, and request body before writing code or integrating the API into your application.
You can use the SynStar AI playground, built-in debugging tools, or third-party API clients such as Postman and Apifox.
When to Use Online Testing
Online testing is useful when you want to:
- Confirm that your API key works
- Check whether a model ID is available
- Test a request body before development
- Debug authentication or endpoint issues
- Compare responses from different models
- Verify that your account balance and token quota are working correctly
Step 1: Open an API Testing Tool
You can test requests using:
- SynStar AI playground or chat testing page
- Postman
- Apifox
- Any HTTP client that supports custom headers and JSON request bodies
Create a new POST request.
Use the chat completions endpoint:
text
https://www.kkiai.com/v1/chat/completionsStep 2: Set the Headers
Add the following headers:
http
Content-Type: application/json
Authorization: Bearer YOUR_API_KEYReplace YOUR_API_KEY with the API key created in your SynStar AI dashboard.
Step 3: Add the Request Body
Use a simple request body for testing:
json
{
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "Say this is a test!"
}
],
"temperature": 0.7
}You can replace gpt-4o with another supported model ID.
Step 4: Send the Request
Click Send or Run in your testing tool.
If the request is successful, you should receive a response containing a choices field.
Example:
json
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1677858242,
"model": "gpt-4o",
"choices": [
{
"message": {
"role": "assistant",
"content": "This is a test!"
},
"finish_reason": "stop",
"index": 0
}
]
}The model output is usually located at:
text
choices[0].message.contentStep 5: Test Different Models
After the first request succeeds, you can test other supported models by changing the Model value.
Example:
json
{
"model": "claude-sonnet-4-20250514",
"messages": [
{
"role": "user",
"content": "Write a short product description."
}
]
}This allows you to compare model output, speed, and cost before using a model in production.
Troubleshooting
Invalid Authorization Header
If you receive an authentication error, check that the Authorization header uses the correct format:
http
Authorization: Bearer YOUR_API_KEYDo not forget the word Bearer.
Invalid API Key
If the API key is rejected, check that:
- The key was copied correctly.
- The key is enabled in Token Management.
- The key has not expired.
- The key has enough quota.
- The selected model is available for this key.
Incorrect Base URL
For direct API testing, use:
text
https://www.kkiai.com/v1/chat/completionsFor SDK configuration, use:
text
https://www.kkiai.com/v1Make sure your tool does not generate a duplicated path such as:
text
https://www.kkiai.com/v1/v1/chat/completionsModel Not Available
If the request fails because the model is not available, check that:
- The model ID is spelled correctly.
- The model is listed in the supported model list.
- Your token group has access to the selected model.
- The model is currently available.
Insufficient Balance or Quota
If the request fails due to balance or quota, check:
- Account balance
- Token quota
- Token group settings
- Minimum required balance for the selected model
You can review usage and balance information in the SynStar AI dashboard.
Browser or Cloud Agent Error
Some browser-based API testing tools may require a local agent, browser extension, or desktop client to send requests.
If the request cannot be sent from the browser:
- Install the required browser extension or local agent if your testing tool asks for it.
- Try the desktop version of the API testing tool.
- Use Postman or a terminal
curlrequest instead. - Confirm that your network can access the endpoint.
Recommended Testing Flow
For a new integration, we recommend this order:
- Create an API key in Token Management.
- Confirm the base URL.
- Send a simple chat completion request.
- Check the response body.
- Test the model you plan to use.
- Move the working configuration into your application.