> ## Documentation Index
> Fetch the complete documentation index at: https://docs.motioness.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Prepare asset

Idempotent — same opts return the same asset_id. First call enqueues generation.

The dashboard primary path. Server-to-server callers can also embed proxy URLs directly without calling prepare — first hit on the proxy URL has the same effect.

` POST /api/v1/prepare `

Prepare (create or fetch) an animated asset for a source URL

## Servers

- ` https://motioness.com ` — Production

## Authentication

The operation accepts these alternatives. Schemes within one alternative are required together.

### Alternative 1

- ` sessionCookie `: ` apiKey `

  - Credential: ` better-auth.session_token ` in ` cookie `

  - Session cookie set by /api/user/signin, /api/user/signup, or the OAuth callback. Required for all authenticated endpoints.

## Request body (optional)

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` project_id `, ` src `

  - ` project_id `: type ` string `

  - ` src `: type ` string `; format ` uri `

  - ` motion `: type ` string `

    - enum: ` ["subtle","medium","kinetic"] `

  - ` dur_seconds `: type ` integer `

    - minimum: ` 2 `

    - maximum: ` 8 `

  - ` mode `: type ` string `

    - enum: ` ["loop","animate-in","animate-on-hover"] `

  - ` prompt_override `: type ` string `

    - maxLength: ` 500 `

  - ` seed `: type ` integer `

## Responses

### ` 200 ` — Asset state

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` asset_id `, ` status `

  - ` asset_id `: type ` string `

  - ` status `: type ` string `

    - enum: ` ["pending","ready","failed"] `

  - ` eta_seconds `: type ` number `

  - ` mp4_url `: type ` string `

  - ` poster_url `: type ` string `

## Request examples

### cURL

```curl
curl -X POST 'https://motioness.com/api/v1/prepare' \
  -H 'Content-Type: application/json' \
  -d '{
  "project_id": "string",
  "src": "https://example.com",
  "motion": "subtle",
  "dur_seconds": 2,
  "mode": "loop",
  "prompt_override": "string",
  "seed": 0
}'
```

### JavaScript

```javascript
const response = await fetch('https://motioness.com/api/v1/prepare', {
  method: 'POST',
  headers: {
      "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "project_id": "string",
    "src": "https://example.com",
    "motion": "subtle",
    "dur_seconds": 2,
    "mode": "loop",
    "prompt_override": "string",
    "seed": 0
  })
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

response = requests.post('https://motioness.com/api/v1/prepare', json={
  "project_id": "string",
  "src": "https://example.com",
  "motion": "subtle",
  "dur_seconds": 2,
  "mode": "loop",
  "prompt_override": "string",
  "seed": 0
})
print(response.json())
```