API Reference
REST API for Silkon models. All endpoints require authentication via Bearer token.
Base URL
https://api.silkonlabs.com/v1POST
/v1/completionsGenerate a text completion from a Silkon model.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| model | string | Required | The model to use (e.g. silkon-1t). |
| prompt | string | Required | The prompt to generate a completion for. |
| max_tokens | integer | Optional | Max tokens to generate. Default: 1024. |
| temperature | number | Optional | Sampling temperature. Default: 0.7. |
| stream | boolean | Optional | Whether to stream the response. Default: false. |
Responses
| Code | Description |
|---|---|
| 200 | Successful completion |
| 400 | Invalid request |
| 401 | Unauthorized |
| 429 | Rate limit exceeded |
Request
curl -X POST https://api.silkonlabs.com/v1/completions \
-H "Authorization: Bearer $SILKON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "silkon-1t",
"prompt": "Explain quantum computing in simple terms.",
"max_tokens": 512,
"temperature": 0.7
}'Response
{
"id": "cmpl_abc123",
"object": "text_completion",
"model": "silkon-1t",
"created": 1737397200,
"choices": [{
"text": "Quantum computing uses qubits...",
"index": 0,
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 8,
"completion_tokens": 32,
"total_tokens": 40
}
}POST
/v1/chat/completionsGenerate a multi-turn chat completion.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Model to use. |
| messages | array | Required | Conversation messages. |
| temperature | number | Optional | Sampling temperature. |
| top_p | number | Optional | Nucleus sampling parameter. |
Responses
| Code | Description |
|---|---|
| 200 | Successful completion |
| 400 | Invalid request |
| 401 | Unauthorized |
Request
curl -X POST https://api.silkonlabs.com/v1/chat/completions \
-H "Authorization: Bearer $SILKON_API_KEY" \
-d '{
"model": "silkon-1t",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'Response
{
"id": "chatcmpl_xyz789",
"object": "chat.completion",
"model": "silkon-1t",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}],
"usage": { "prompt_tokens": 5, "completion_tokens": 9, "total_tokens": 14 }
}GET
/v1/modelsList available models.
Responses
| Code | Description |
|---|---|
| 200 | List of models |
| 401 | Unauthorized |
Request
curl https://api.silkonlabs.com/v1/models \ -H "Authorization: Bearer $SILKON_API_KEY"
Response
{
"data": [
{ "id": "silkon-1t", "object": "model", "created": 1737300000, "owned_by": "silkon" },
{ "id": "silkon-7b", "object": "model", "created": 1737200000, "owned_by": "silkon" }
]
}