# The 10xvid API

Make video ads from your own code: what the API does, its base address, how to authenticate, and the resources you can use.

## What it does

The API makes the same videos as the app. One request with a link reads the site, writes the Format DNA and makes a video in each style you ask for. You can make more videos from a format later, make image ads, list the styles, and read your balance. Finished files come back as links you can pass straight to an ad account.

## Base address

```http
https://10xvid.com/api/v1
```

Every request and answer is JSON. Send `Content-Type: application/json` with a body.

## Authentication

Send your API key with every request, as `Authorization: Bearer tenx_...`. Make keys on the [API keys](/app/api-keys) page of the app. See [Authentication and keys](/docs/api/authentication).

## Resources

| Resource | What you do with it | Reference |
|---|---|---|
| Formats | Make one from a link, read it, list them, delete one | [Formats API](/docs/api/reference/formats) |
| Videos | Make more videos from a format, read one, list them | [Videos API](/docs/api/reference/videos) |
| Image ads | Make image ads from a format, read them | [Image ads API](/docs/api/reference/images) |
| Styles | List the hundred styles and Pure | [Styles API](/docs/api/reference/styles) |
| Account | Read your credits, balance, prices and limits | [Account API](/docs/api/reference/account) |

## How a request goes

1. `POST /formats` with a link answers at once with the format, `"status": "reading"`.
2. The site is read, then the Format DNA is written: `"status": "writing"`, then `"ready"`.
3. The videos start by themselves, each `"status": "making"`, then `"done"` with its files, or `"failed"` with what it cost given back.
4. Ask for the format again with `GET /formats/{id}`, or let a [webhook](/docs/api/webhooks) tell your server as each step ends.

## Next steps

- [Quickstart](/docs/api/quickstart) Your first video through the API, from the key to the finished file.
- [Authentication and keys](/docs/api/authentication) Send your key, and limit what a key may do.
- [Webhooks](/docs/api/webhooks) Be told when a format or video is ready.
- [API pricing](/docs/api/pricing) What calls cost, and what pays for them.
