본문으로 건너뛰기
문서:Quickstart

시작하기

Quickstart

Create an API key, generate an image with the Task API, and make a chat call with the OpenAI SDK.

이 페이지는 아직 번역되지 않아 영어 원문을 표시합니다.

This page takes you from nothing to a finished image and a chat reply. You need a terminal with curl, or Node.js 18+ or Python 3.

1. Get an API key

  1. Sign in to the console with your e-mail address. There is no password: you receive a six-digit code. The first sign-in creates your account and an organization.
  2. Open Billing and top up. The smallest package is $5.
  3. Open API keys, create a key and copy it. The full key is shown once.

Put the key in an environment variable so it stays out of your code:

Shell
export MINU_API_KEY="mk_live_…"

2. Check that the key works

Shell
curl https://api.minu.ai/v1/balance \
  -H "Authorization: Bearer $MINU_API_KEY"
JSON
{
  "object": "balance",
  "currency": "usd",
  "balance_usd": "5.000000",
  "reserved_usd": "0.000000",
  "available_usd": "5.000000"
}

3. Create a task

Images, video and music are made by tasks: you create one, it runs, and you fetch the result. This creates an image with Nano Banana 2:

curl https://api.minu.ai/v1/tasks \
  -H "Authorization: Bearer $MINU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/nano-banana-2",
    "input": {
      "prompt": "A paper boat on a rain puddle, macro, soft morning light"
    }
  }'

The response is the task. It starts as queued, and its price is reserved from your balance:

JSON
{
  "id": "task_1k8r2m4p0a7c9e3g5j6n8q2s",
  "object": "task",
  "model": "google/nano-banana-2",
  "status": "queued",
  "input": { "prompt": "A paper boat on a rain puddle, macro, soft morning light" },
  "outputs": [],
  "error": null,
  "estimated_cost_usd": "0.033000",
  "cost_usd": null,
  "metadata": null,
  "created_at": 1796169600,
  "started_at": null,
  "completed_at": null
}

The input you get back also holds the model's defaults for the parameters you left out.

4. Get the result

Ask for the task until its status is final:

curl https://api.minu.ai/v1/tasks/task_1k8r2m4p0a7c9e3g5j6n8q2s \
  -H "Authorization: Bearer $MINU_API_KEY"

A finished task lists its results in outputs and says what it cost:

JSON
{
  "id": "task_1k8r2m4p0a7c9e3g5j6n8q2s",
  "object": "task",
  "model": "google/nano-banana-2",
  "status": "succeeded",
  "outputs": [
    { "index": 0, "type": "image", "url": "https://…", "mime": "image/png", "bytes": 1482930 }
  ],
  "error": null,
  "estimated_cost_usd": "0.033000",
  "cost_usd": "0.033000",
  "completed_at": 1796169612
}

Download the file from url. Result files are kept for 14 days by default.

If the task had failed, status would be failed, error would say why and cost_usd would be "0.000000": you pay only for results that are delivered.

5. Make a chat call

Chat models speak the OpenAI API. Install the official SDK (npm install openai or pip install openai) and point it at Minu:

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env.MINU_API_KEY,
  baseURL: 'https://api.minu.ai/v1',
});

const completion = await client.chat.completions.create({
  model: 'deepseek/deepseek-v4.1-flash',
  messages: [{ role: 'user', content: 'Write a haiku about queues.' }],
});

console.log(completion.choices[0].message.content);

Model IDs are listed in the model reference and returned by GET /v1/models.

Next steps

  • Task API: every field of a task, idempotent retries, listing and canceling.
  • Webhooks: receive results instead of polling, and verify the signature.
  • Files: upload an image to use as a task input.
  • Errors and rate limits: what to retry and when.
  • Model reference: parameters and prices of each model.