> For the complete documentation index, see [llms.txt](https://docs.tensorx.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tensorx.ai/api-reference/models.md).

# Models

Use the model APIs to retrieve the catalogue and deployment metadata available to your API key.

## List available models

`GET /v1/models` returns the model IDs that the authenticated key can use.

```bash
curl https://api.tensorx.ai/v1/models \
  -H "Authorization: Bearer $TENSORX_API_KEY"
```

To print only the IDs:

```bash
curl -sS https://api.tensorx.ai/v1/models \
  -H "Authorization: Bearer $TENSORX_API_KEY" \
  | jq -r '.data[].id'
```

Use an ID from this response as the `model` value in API requests. Access can differ by key, so this endpoint is the source of truth for availability.

## Inspect model metadata

`GET /v1/model/info` returns customer-visible metadata for the available models.

```bash
curl -sS https://api.tensorx.ai/v1/model/info \
  -H "Authorization: Bearer $TENSORX_API_KEY" \
  | jq '.data[] | {
      model: .model_name,
      mode: .model_info.mode,
      max_input_tokens: .model_info.max_input_tokens,
      max_output_tokens: .model_info.max_output_tokens,
      quantization: .model_info.quantization,
      supports_reasoning: .model_info.supports_reasoning,
      supports_function_calling: .model_info.supports_function_calling,
      supports_vision: .model_info.supports_vision,
      supports_prompt_caching: .model_info.supports_prompt_caching
    }'
```

Fields that do not apply to a model can be `null` or absent. Read the returned values rather than assuming that every model supports the same parameters.

## Use a selected model

The example below reads the model ID from an environment variable so it can be changed without editing the application.

```python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["TENSORX_API_KEY"],
    base_url="https://api.tensorx.ai/v1"
)

response = client.chat.completions.create(
    model=os.environ["TENSORX_MODEL"],
    messages=[{"role": "user", "content": "Explain quantum computing."}]
)

print(response.choices[0].message.content)
```

## Pricing

Current pricing is published at [tensorx.ai/models](https://tensorx.ai/models). The model cards include input, cache-read and output prices where applicable.

## See also

* [Chat Completions](/api-reference/chat-completions.md)
* [Reasoning](/api-reference/reasoning.md)
* [Quantisation](/api-reference/quantisation.md)
* [Function Calling](/api-reference/function-calling.md)
* [Audio API](/api-reference/audio.md)
* [Embeddings](/api-reference/embeddings.md)
* [Model Deprecation](/api-reference/model-deprecation.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tensorx.ai/api-reference/models.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
