Docs / Quickstart

Get started

Quickstart

Create a key, send a motor's STEP model, build a bracket that fits it, and download the bracket as STEP.

This walk through uses curl. Each step is one request.

1. Create a key

In Ragnar, open Settings → Developers, choose New key and pick Read and build. Copy the key: Ragnar shows it only once. Then keep the base URL and the key in your shell:

Terminal
export RAGNAR_API="https://app.ragnar.build/api"
export RAGNAR_API_KEY="<your API key>"

2. Create a project

A project holds your design, its chats and its folder of files. Leave out workspace_id for a personal project. On the free plan a personal project is public, can be remixed and joins the community gallery after its first successful build. Pass a workspace_id, or use Pro, to keep it private. See Workspaces.

Terminal
curl -X POST "$RAGNAR_API/v1/projects" \
  -H "Authorization: Bearer $RAGNAR_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"name": "Motor bracket"}'

201 Created
{ "id": "<project_id>", "name": "Motor bracket", "workspace_id": null, "created_at": "2026-11-20T09:12:00.000Z" }

3. Open a chat

A new project has one empty chat. The first chat you open uses it, so Ragnar shows the same chat.

Terminal
curl -X POST "$RAGNAR_API/v1/chats" \
  -H "Authorization: Bearer $RAGNAR_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"project_id": "<project_id>"}'

201 Created
{ "id": "<chat_id>", "project_id": "<project_id>", "created_at": "2026-11-20T09:12:01.000Z" }

4. Upload a file

The request body is the file, as it is on disk. The file goes in the project's folder.

Terminal
curl --data-binary @motor.step \
  "$RAGNAR_API/v1/files?project_id=<project_id>&name=motor.step" \
  -H "Authorization: Bearer $RAGNAR_API_KEY"

201 Created
{ "id": "<file_id>", "name": "motor.step", "size": 120044, "project_id": "<project_id>", "author": { "type": "user", "id": "<user_id>", "name": "Anna" }, "created_at": "2026-11-20T09:12:05.000Z" }

5. Send a message

Name the file in files. The Idempotency-Key is optional: it makes a retry of this request safe.

Terminal
curl -X POST "$RAGNAR_API/v1/chats/<chat_id>/messages" \
  -H "Authorization: Bearer $RAGNAR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  --data '{"text": "Make a bracket that fits this motor. Export it as STEP.", "files": [{"id": "<file_id>"}]}'

201 Created
{
  "id": "<message_id>",
  "author": { "type": "user", "id": "<user_id>", "name": "Anna" },
  "text": "Make a bracket that fits this motor. Export it as STEP.",
  "files": [{ "id": "<file_id>", "name": "motor.step", "size": 120044 }],
  "reply_to": [],
  "task_id": "<task_id>",
  "created_at": "2026-11-20T09:12:40.000Z"
}

6. Follow the task

Read the task about every 5 seconds. It goes from pending to working to answered.

Terminal
curl "$RAGNAR_API/v1/tasks/<task_id>" \
  -H "Authorization: Bearer $RAGNAR_API_KEY"

200 OK
{ "id": "<task_id>", "message_id": "<message_id>", "status": "answered", "reason": null }

If the task is paused or failed, reason says why. See task statuses.

7. Read the reply

Read the messages after the one you sent:

Terminal
curl "$RAGNAR_API/v1/chats/<chat_id>/messages?after=<message_id>" \
  -H "Authorization: Bearer $RAGNAR_API_KEY"

200 OK
{
  "data": [
    {
      "id": "<reply_id>",
      "author": { "type": "agent", "id": "ragnar", "name": "Ragnar" },
      "text": "[Download the bracket as STEP](ragnar:export?format=step)\n\nThe bracket fits the motor's four M4 holes.",
      "files": [{ "id": "<bracket_file_id>", "name": "assembly.step", "size": 48213 }],
      "reply_to": ["<message_id>"],
      "task_id": null,
      "created_at": "2026-11-20T09:14:03.000Z"
    }
  ],
  "next_cursor": null
}

The reply's files hold what the build made. A ragnar: link in its text is a button in the app; see exports. A reply with a task_id is a question instead: answer it with a new message and follow that message's task. See questions.

8. Download the file

Terminal
curl -f "$RAGNAR_API/v1/files/<bracket_file_id>/content" \
  -H "Authorization: Bearer $RAGNAR_API_KEY" \
  --output assembly.step

To export the saved design again at any time, send the message /export step. See exports.