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

# Quickstart

> Generate your first animation in three requests.

## 1. Create a project

```bash theme={null}
curl -X POST https://mathify.dev/api/v1/projects \
  -H "x-api-key: $MATHIFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "pythagorean-theorem" }'
```

The body is optional — omit it (or drop `name`) and a random project name is
generated for you instead.

Returns:

```json theme={null}
{ "project": { "id": "proj_123", "name": "...", "userId": "...", "createdAt": "...", "updatedAt": "..." } }
```

## 2. Send a message to start generation

```bash theme={null}
curl -X POST https://mathify.dev/api/v1/projects/proj_123/messages \
  -H "x-api-key: $MATHIFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "content": "Animate the Pythagorean theorem" }'
```

Returns `202 Accepted`:

```json theme={null}
{ "messageId": "msg_123", "fragmentId": "frag_123", "status": "generating", "totalSteps": 12 }
```

## 3. Poll for the result

```bash theme={null}
curl https://mathify.dev/api/v1/fragments/frag_123 \
  -H "x-api-key: $MATHIFY_API_KEY"
```

Poll until `fragment.animationUrl` is non-null (it's `null` while generating).
Once set, that URL is a signed link to the rendered video, refreshed
automatically on each request if the previous signature expired.

See the [API Reference](/docs/api-reference) for every endpoint, or
[N8N examples](/docs/n8n-examples) for automating this flow end-to-end.
