Inference API provides an OpenAI-compatible interface for chat completions, streaming chat completions, server-side inference tools, embeddings, and model listing. Standard OpenAI-compatible SDKs and HTTP clients can connect to the API using Tempico endpoints and a Tempico API key. Server-side inference tools can perform web searches, inspect encoded or obfuscated data, validate and extract JSON, and query supported security-reputation sources on behalf of the model.
Authentication
All API requests require an API key. Bearer authentication is the recommended method. For compatibility, the API also supports x-api-key: <API_KEY> header.
Server-side inference tool permissions
Server-side inference tools require API-key permission in addition to access to /v1/chat/completions.
The Code-analysis and system utilities permission uses the inference_tool:sys_utils scope to enable both sys_utils and json_utils, with no separate inference_tool:json_utils permission.
Full-access API keys using * authorize both tools automatically. Existing custom-scope keys without inference_tool:sys_utilsremain unchanged. Create a new key with the permission when access is required.
For custom API keys, select Code-analysis and system utilities while granting access to /v1/chat/completions.
List models
Returns available model IDs for the current account. Returned id values can be used as the model field in chat completion and embedding requests.
{
"object": "list",
"data": [
{
"id": "kimi-k2.7-code:1t",
"object": "model",
"created": 0,
"owned_by": "tempicolabs",
"context_window": 262144,
"capabilities": [
"chat"
],
"max_output_tokens": 65536
},
{
"id": "embeddinggemma:300m",
"object": "model",
"created": 0,
"owned_by": "tempicolabs",
"context_window": 2048,
"capabilities": [
"embeddings"
]
}
]
}
| Field | Description |
id | Model ID used in API requests. |
created | Model creation timestamp when available. |
context_window | Maximum context length supported by the model, in tokens. |
capabilities | Supported API features for the model, such as chat or embeddings. |
max_output_tokens | Maximum output token limit when available. |
Chat completions
Generates a model response from a conversation in OpenAI chat format. The endpoint supports standard JSON responses, streaming output, and server-side web search.
Web search
Server-side web search works as a tool available to the model during chat completion generation. For most chat models, web search is enabled by default. The model decides when search is needed and what query should be used.
Search behavior can be controlled through the prompt. System or user messages can define when search should be used, what sources to prefer, and when the model should answer without searching.
Set web_search to false to disable server-side search for a specific request.
curl https://api.tempico.com/v1/chat/completions \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "kimi-k2.7-code:1t", "messages": [ { "role": "system", "content": "You are a concise technical assistant." }, { "role": "user", "content": "Search the web and summarize the current Python 3.13 release status." } ], "max_tokens": 800, "temperature": 0.2, "web_search": true, "web_search_options": { "search_context_size": "medium", "user_location": { "type": "approximate", "approximate": { "country": "US" } }, "safesearch": "moderate" } }'
| Field | Description |
model | Model that generated the response. |
messages | Conversation history sent to the model in OpenAI chat format. |
max_tokens | Maximum number of tokens the model can generate in the response. |
web_search | Enables or disables server-side web search. Enabled by default for most models. |
search_context_size | Amount of search context passed to the model. Supported values are low, medium, and high. |
country | Country code used as the location hint. |
safesearch | Search safety preference passed to the search backend. |
accept_language | Language preference for search results. |
Example Response
{
"id": "chatcmpl-0000000000000000",
"object": "chat.completion",
"created": 0,
"model": "kimi-k2.7-code:1t",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The answer text appears here."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 120,
"completion_tokens": 64,
"total_tokens": 184
}
}
| Field | Description |
finish_reason | Reason generation stopped, such as reaching a stop condition or token limit. |
usage | Token usage information for the request. |
prompt_tokens | Number of input tokens processed by the model. |
completion_tokens | Number of output tokens generated by the model. |
total_tokens | Sum of input and output tokens. |
Code-analysis and system utilities
Code-analysis and system utilities are bounded, non-executing tools available to the model during chat completion generation. They support static inspection and deterministic utility tasks such as inspecting escaped malware code, decoding layered payloads, validating JSON, calculating cryptographic digests, and working with timestamps.
For an API key authorized by inference_tool:sys_utils, both utilities are enabled by default. The model decides whether they are needed.
Set sys_utils to false to disable both sys_utils and json_utils for a request.
{
"model": "kimi-k2.7-code:1t",
"messages": [
{
"role": "user",
"content": "Explain this Python function."
}
],
"sys_utils": false
}
Setting sys_utils to true without the required permission returns 403 Forbidden.
Clients should not add sys_utils or json_utils definitions to the tools array. Tempico injects and executes these managed tools server-side. The client receives a normal chat-completion response, while managed tool calls and intermediate results remain server-side.
Each managed utility can be invoked once during a completion and its continuation chain. One invocation can batch up to 16 ordered operations.
curl https://api.tempico.com/v1/chat/completions \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "kimi-k2.7-code:1t", "messages": [ { "role": "user", "content": "Without executing it, decode this PowerShell -EncodedCommand, explain the decoded content, and report its full-buffer SHA-256: VwByAGkAdABlAC0ATwB1AHQAcAB1AHQA" } ], "sys_utils": true, "max_tokens": 1200 }'
sys_utils is optional in this example because authorized requests enable both utilities by default.
| Tool | Operation | Description |
sys_utils | bytes_transform | Performs an explicit sequence of bounded byte transformations for static code and payload analysis. |
sys_utils | checksum | Calculates SHA-256 or SHA-512 over caller-supplied text or encoded bytes. |
sys_utils | hmac | Signs or verifies data with HMAC-SHA-256 or HMAC-SHA-512. |
sys_utils | uuid_v4 | Generates UUIDv4 identifiers. |
sys_utils | random_token | Generates bounded hex or unpadded Base64URL random identifiers. |
sys_utils | datetime | Gets the current time, parses timestamps, converts timezones, and performs fixed timedelta arithmetic. |
sys_utils | decimal_math | Performs exact or explicitly rounded decimal arithmetic without evaluating expressions. |
json_utils | document | Validates one complete JSON document or extracts values using RFC 6901 pointers. |
Base64, UUID, checksum, and datetime are operations within sys_utils, not separate server-side tool names.
Static byte analysis
bytes_transform supports explicit transformation pipelines over UTF-8, Base64, Base64URL, or hexadecimal input.
Available transformations include:
- Base64, Base64URL, and hexadecimal encoding or decoding
- Strict percent decoding, where
+remains a literal plus sign - UTF-8, UTF-16LE, UTF-16BE, and Latin-1 transcoding
- C-style, JSON, JavaScript, and PowerShell escape decoding
- Repeating-key XOR with an explicitly supplied key
- gzip, zlib, and raw DEFLATE decompression
Example workflows include:
- PowerShell Base64 to UTF-16LE to UTF-8
- Base64 to raw DEFLATE to UTF-8
- C-style escaped bytes to repeating-key XOR
- Percent encoding to JavaScript escape decoding to Base64
Each transformation pipeline is explicit. The tool does not guess encodings, recursively decode content, search for XOR keys, execute code, or emulate a runtime.
Every successful byte-analysis result includes the complete byte count and SHA-256. It also includes entropy, printable-byte ratio, transformation sizes, and per-step SHA-256 values. SHA-512 can be requested when needed.
Large results are returned as clearly marked head and tail previews. Digests always cover the complete transformed buffer, not only the preview
Checksums, HMACs, and identifiers
Checksums support only SHA-256 and SHA-512. MD5, SHA-1, and arbitrary hash algorithms are not supported.
Checksums operate only on data supplied as UTF-8, Base64, Base64URL, or hexadecimal input. The tool cannot open filesystem paths, download URLs, or read stored malware samples.
Calculating a digest does not automatically query or submit it to the Malware Hash Registry. Hash reputation requires a separate, explicitly authorized hash_reputation operation.
HMAC supports signing and constant-time verification with SHA-256 or SHA-512. HMAC keys and messages are visible to the model and inference provider. Do not use this tool with long-lived API keys, platform credentials, or secrets that must remain hidden from the model.
uuid_v4 generates UUIDv4 identifiers. Random tokens are intended as random identifiers. They are not secret-custody objects and should not be used as passwords, API keys, or platform credentials.
Datetime and decimal arithmetic
Datetime operations support:
- Current time, with UTC as the default
- Strict RFC 3339 timestamps
- Explicit Unix seconds or milliseconds
- IANA timezones
- Timezone conversion
- Fixed timedelta arithmetic
- Daylight-saving transitions
Ambiguous local times require an explicit fold selection. Nonexistent local times during daylight-saving transitions are rejected.
Decimal operations accept decimal strings instead of JSON floating-point numbers. Exact mode rejects non-terminating or irrational results. Rounded mode requires an explicit precision or scale and an explicit rounding rule. Mathematical expressions are not evaluated.
Strict JSON utilities
json_utils validates one complete RFC 8259 JSON document or extracts ordered values using RFC 6901 pointers.
Validation rejects:
- Byte-order marks
- Duplicate object keys
- Trailing content
- NaN and Infinity
- Numeric overflow
- Unpaired Unicode surrogates
- Excessive nesting or document size
Extraction uses RFC 6901 JSON Pointer syntax. An empty pointer selects the document root. Missing values are distinguished from JSON null.
The tool does not scan prose for embedded JSON, repair malformed documents, evaluate JSONPath, validate JSON Schema, or execute extracted content.
Safety and trust
Decoded, decompressed, transformed, and extracted values remain attacker-controlled data. They must not be treated as model instructions, system messages, commands, links to follow, or authorization claims.
These utilities never provide:
- Shell or subprocess execution
eval,exec, compilation, or imports- Script runtimes or emulation
- Filesystem or network access
- Database or message-queue access
- Archive extraction
- User-provided regular-expression execution
- XOR brute force or heuristic decoder guessing
- Automatic malware submission or reputation lookup
Resource limits
| Limit | Value |
| Operations per tool invocation | 16 |
Byte pipelines per sys_utils invocation | 4 |
| Steps per byte pipeline | 8 |
| Decoded initial input per pipeline | 128 KiB |
| Aggregate decoded input per invocation | 256 KiB |
| Working or final byte buffer per pipeline | 1 MiB |
| Cumulative transformed bytes per invocation | 2 MiB |
| Default emitted result data | 16 KiB |
| Maximum emitted result data | 64 KiB |
| Maximum serialized tool result | 128 KiB |
| JSON document size | 128 KiB |
| JSON pointers per extraction | 32 |
| Maximum JSON depth | 64 |
| Maximum JSON nodes | 10,000 |
| UUIDv4 identifiers per operation | 100 |
| Random identifiers per operation | 16 |
Decompression is additionally limited to 128 times the compressed input size and a maximum of 1 MiB. Truncated streams, trailing compressed data, concatenated streams, and excessive expansion are rejected.
Context and token usage
There is no separate charge for using sys_utils or json_utils. Normal inference token usage still applies. When enabled, tool schemas and results occupy part of the model context. Applications that do not need these utilities should send:
{
"sys_utils": false
}
This is particularly relevant for full-access API keys because * authorizes and enables both utilities by default.
Example Response
{
"id": "chatcmpl-0000000000000000",
"object": "chat.completion",
"created": 0,
"model": "kimi-k2.7-code:1t",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The answer text appears here."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 120,
"completion_tokens": 64,
"total_tokens": 184
}
}
| Field | Description |
finish_reason | Reason generation stopped, such as reaching a stop condition or token limit. |
usage | Token usage information for the request. |
prompt_tokens | Number of input tokens processed by the model. |
completion_tokens | Number of output tokens generated by the model. |
total_tokens | Sum of input and output tokens. |
Image input
Models with image support accept Base64-encoded images in a user message. Provide the prompt and image as separate content parts:
curl https://api.tempico.com/v1/chat/completions \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "kimi-k3:2.8t", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image." }, { "type": "image_url", "image_url": { "url": "data:image/jpeg;base64,<BASE64_DATA>" } } ] } ] }'
Replace <BASE64_DATA> with the image’s Base64-encoded bytes without line breaks. The MIME type must match the file—for example, use data:image/png;base64,... for PNG images.
Additional images can be supplied as additional image_url content parts. Image support and limits depend on the selected model. Resize or compress large images before encoding because Base64 increases request size and a potential token usage.
Streaming chat completions
Returns a chat completion as a stream of Server-Sent Events. Each event contains a partial response chunk. The stream ends with data: [DONE].
curl https://api.tempico.com/v1/chat/completions \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "kimi-k2.7-code:1t", "stream": true, "messages": [ { "role": "user", "content": "Write a short Python example using requests." } ] }'
Example Stream Response
data: {
"id": "chatcmpl-0000000000000000",
"object": "chat.completion.chunk",
"created": 0,
"model": "kimi-k2.7-code:1t",
"choices": [
{
"index": 0,
"delta": {
"role": "assistant"
},
"finish_reason": null
}
]
}
data: {
"id": "chatcmpl-0000000000000000",
"object": "chat.completion.chunk",
"created": 0,
"model": "kimi-k2.7-code:1t",
"choices": [
{
"index": 0,
"delta": {
"content": "import requests\n\n"
},
"finish_reason": null
}
]
}
data: {
"id": "chatcmpl-0000000000000000",
"object": "chat.completion.chunk",
"created": 0,
"model": "kimi-k2.7-code:1t",
"choices": [
{
"index": 0,
"delta": {},
"finish_reason": "stop"
}
]
}
data: [DONE]
| Field | Description |
stream | Enables streaming mode when set to true. The response is returned as Server-Sent Events instead of one JSON object. |
choices | Array of streamed output choices. For normal single-response generation, this usually contains one item. |
index | Position of the choice in the choices array. |
delta | Incremental update for the assistant message. This object can contain role, content, or be empty in the final chunk. |
finish_reason | Indicates why generation ended. The value is null while generation is still running. |
data: [DONE] | Final stream marker. No more chunks are sent after this event. |
Embeddings
Embeddings convert text input into vectors for semantic search, similarity matching, clustering, and ranking.
curl https://api.tempico.com/v1/embeddings \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "embeddinggemma:300m", "input": "Represent this text as a vector for semantic search." }'
Example Response
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.0123,
-0.0456,
0.0789
]
}
],
"model": "embeddinggemma:300m",
"usage": {
"prompt_tokens": 12,
"total_tokens": 12
}
}
| Field | Description |
input | Text or array of texts used to create embeddings. |
embedding | Vector representation of the input text. |
prompt_tokens | Number of input tokens processed by the model. |
total_tokens | Total tokens counted for the request. |