Models

List and retrieve information about available models. Use these endpoints to discover which models are available, their capabilities, context lengths, and pricing.

Endpoints

GET https://api.tensoras.ai/v1/models
GET https://api.tensoras.ai/v1/models/{model_id}

Authentication

Authorization: Bearer tns_your_key_here

List Models

Retrieve a list of all models currently available on the Tensoras platform.

Request

GET /v1/models

No request body is required.

Response Body

{
  "object": "list",
  "data": [
    {
      "id": "llama-3.3-70b",
      "object": "model",
      "created": 1709123456,
      "owned_by": "meta",
      "capabilities": {
        "chat_completion": true,
        "completion": true,
        "function_calling": true,
        "json_mode": true,
        "streaming": true
      },
      "context_length": 131072,
      "pricing": {
        "prompt": 0.0008,
        "completion": 0.0008,
        "unit": "per_1k_tokens"
      }
    },
    {
      "id": "llama-3.1-8b",
      "object": "model",
      "created": 1709123456,
      "owned_by": "meta",
      "capabilities": {
        "chat_completion": true,
        "completion": true,
        "function_calling": true,
        "json_mode": true,
        "streaming": true
      },
      "context_length": 131072,
      "pricing": {
        "prompt": 0.0002,
        "completion": 0.0002,
        "unit": "per_1k_tokens"
      }
    },
    {
      "id": "qwen-3-32b",
      "object": "model",
      "created": 1709123456,
      "owned_by": "alibaba",
      "capabilities": {
        "chat_completion": true,
        "completion": true,
        "function_calling": true,
        "json_mode": true,
        "streaming": true
      },
      "context_length": 32768,
      "pricing": {
        "prompt": 0.0006,
        "completion": 0.0006,
        "unit": "per_1k_tokens"
      }
    }
  ]
}
FieldTypeDescription
objectstringAlways "list".
dataarrayA list of model objects.
data[].idstringThe model identifier used in API requests.
data[].objectstringAlways "model".
data[].createdintegerUnix timestamp of when the model was added.
data[].owned_bystringThe organization that created the model.
data[].capabilitiesobjectDescribes what the model supports.
data[].capabilities.chat_completionbooleanWhether the model supports chat completions.
data[].capabilities.completionbooleanWhether the model supports legacy completions.
data[].capabilities.function_callingbooleanWhether the model supports function/tool calling.
data[].capabilities.json_modebooleanWhether the model supports JSON mode output.
data[].capabilities.streamingbooleanWhether the model supports streaming responses.
data[].context_lengthintegerMaximum context length in tokens.
data[].pricingobjectPricing information.
data[].pricing.promptnumberCost per unit for prompt tokens.
data[].pricing.completionnumberCost per unit for completion tokens.
data[].pricing.unitstringThe pricing unit, e.g. "per_1k_tokens".

Available Models

ModelProviderContext LengthDescription
llama-3.3-70bMeta131,072High-performance general-purpose model with excellent reasoning.
llama-3.1-8bMeta131,072Fast and cost-effective model for simpler tasks.
qwen-3-32bAlibaba32,768Strong multilingual model with broad capabilities.
mistral-7b-instructMistral32,768Efficient instruction-following model.
deepseek-r1-distill-70bDeepSeek65,536Reasoning-focused model with chain-of-thought capabilities.
codestral-latestMistral32,768Specialized model for code generation and understanding.

Get Model

Retrieve details about a specific model.

Request

GET /v1/models/{model_id}
ParameterTypeRequiredDescription
model_idstringYesThe ID of the model to retrieve (path parameter).

Response Body

{
  "id": "llama-3.3-70b",
  "object": "model",
  "created": 1709123456,
  "owned_by": "meta",
  "capabilities": {
    "chat_completion": true,
    "completion": true,
    "function_calling": true,
    "json_mode": true,
    "streaming": true
  },
  "context_length": 131072,
  "pricing": {
    "prompt": 0.0008,
    "completion": 0.0008,
    "unit": "per_1k_tokens"
  }
}

Examples

List All Models

curl

curl https://api.tensoras.ai/v1/models \
  -H "Authorization: Bearer tns_your_key_here"

Python

from openai import OpenAI
 
client = OpenAI(
    base_url="https://api.tensoras.ai/v1",
    api_key="tns_your_key_here",
)
 
models = client.models.list()
 
for model in models.data:
    print(f"{model.id} (owned by {model.owned_by})")

Node.js

import OpenAI from "openai";
 
const client = new OpenAI({
  baseURL: "https://api.tensoras.ai/v1",
  apiKey: "tns_your_key_here",
});
 
const models = await client.models.list();
 
for (const model of models.data) {
  console.log(`${model.id} (owned by ${model.owned_by})`);
}

Get Model Details

curl

curl https://api.tensoras.ai/v1/models/llama-3.3-70b \
  -H "Authorization: Bearer tns_your_key_here"

Python

from openai import OpenAI
 
client = OpenAI(
    base_url="https://api.tensoras.ai/v1",
    api_key="tns_your_key_here",
)
 
model = client.models.retrieve("llama-3.3-70b")
 
print(f"Model: {model.id}")
print(f"Owner: {model.owned_by}")

Node.js

import OpenAI from "openai";
 
const client = new OpenAI({
  baseURL: "https://api.tensoras.ai/v1",
  apiKey: "tns_your_key_here",
});
 
const model = await client.models.retrieve("llama-3.3-70b");
 
console.log(`Model: ${model.id}`);
console.log(`Owner: ${model.owned_by}`);

Error Handling

{
  "error": {
    "message": "Model 'nonexistent-model' not found",
    "type": "not_found_error",
    "param": "model_id",
    "code": "model_not_found"
  }
}