---
name: scalingtensor
description: Call 23 AI models for video generation, music generation, sound effects and video dubbing through the ScalingTensor API with one API key. Use when a project needs video, music, sound-effect, dubbing or chat generation from ScalingTensor.
---

# Using the ScalingTensor API

ScalingTensor serves 23 AI models for video generation, music generation, sound effects and video dubbing behind one HTTP/JSON API. Follow these steps in order.

## 1. Get an API key

The key is created by a human. Ask the user to:

1. Open https://scalingtensor.com/console and sign in with Google (the first sign-in creates the account).
2. Top up the wallet (minimum $10). Requests fail without a balance.
3. Create an API key and put it in the project's environment as `SCALINGTENSOR_API_KEY`.

Never hard-code the key, commit it, or send it from browser code. Call the API from a server or script.

## 2. Pick a model

- Machine-readable catalog: `GET https://restapi.scalingtensor.com/models/list` (no key needed). Each item has `slug` (the model ID), `displayName`, `tags` and `priceConfig`.
- Human-readable list with prices: https://scalingtensor.com/models
- Parameters for one model: https://scalingtensor.com/docs/models/<model ID>.md

Tell the user the model's price before running jobs that cost money.

## 3. Submit a media job

```bash
curl --request POST 'https://restapi.scalingtensor.com/api/media/generate' \
  --header "apiKey: $SCALINGTENSOR_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{"model": "<model ID>", "params": { ... }}'
```

Parameters go inside `params`, exactly as listed on the model's Markdown page. A response with `code` 0 contains `data.jobId`. Any other `code` is an error; read `msg`.

## 4. Poll for the result

```bash
curl 'https://restapi.scalingtensor.com/api/media/result?jobId=<jobId>' \
  --header "apiKey: $SCALINGTENSOR_API_KEY"
```

Repeat every few seconds until `data.status` is `completed` or `failed`. Video jobs can take minutes; use a timeout and back off rather than polling in a tight loop. On `completed`, the output URLs are in `data.resultData`; download and store them, since provider URLs may expire.

## 5. Chat models

If the catalog lists a model with `type` "chat", call `POST https://restapi.scalingtensor.com/api/chat/completion` with `model` and `messages`. The response is `{code, data: {content, tokensIn, tokensOut, costMicros}}`, not the OpenAI format, so do not point an OpenAI SDK at it without an adapter.

## Reference

- API reference: https://scalingtensor.com/docs/api.md
- Everything in one file: https://scalingtensor.com/llms-full.txt
- Pricing: https://scalingtensor.com/pricing
