For the complete documentation index, see llms.txt. This page is also available as Markdown.

API Examples

Sample curl commands to get you started with the TensorX API. All examples use the OpenAI-compatible endpoint.

Replace YOUR_API_KEY with your actual TensorX API key from app.tensorx.ai.


Basic Chat Completion

A simple chat request with GLM-5.1:

curl https://api.tensorx.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "z-ai/glm-5.1",
    "messages": [
      {"role": "user", "content": "What is the capital of France?"}
    ]
  }'

Multi-turn Conversation

Include conversation history for context:


Streaming Response

Get responses token-by-token for real-time output:


Code Generation

Ask for code with a system prompt:


With Temperature Control

Adjust creativity with temperature (0.0 = focused, 1.0 = creative):


Using MiniMax Models

Switch to MiniMax-M2.5 for different capabilities:


List Available Models

Check which models are available:


Python Example

Using the OpenAI Python SDK:


JavaScript/Node.js Example

Using the OpenAI Node.js SDK:


Available Models

Model
ID
Best For

GLM-5.1

z-ai/glm-5.1

Coding, reasoning, general use

MiniMax-M2.5

minimax/minimax-m2.5

Reasoning, functions

Kimi-K2.5

moonshotai/kimi-k2.5

Vision, functions, long context

MiniMax-M2

minimax/minimax-m2

Coding, fast responses

DeepSeek V3.1

deepseek/deepseek-chat-v3.1

General chat, reasoning

DeepSeek R1

deepseek/deepseek-r1-0528

Complex problem solving

For the full list of models and pricing, visit tensorx.ai.

Last updated

Was this helpful?