# Fibo 2.0 Edit API

> 1〜4 枚の画像を扱い、単一画像の領域編集には任意のマスクを使える指示ベースのエディター

`image_urls` に指定した 1〜4 枚の画像を編集します。`instruction` では画像を <image_1>、<image_2> のように参照します。背景の置換や商品の再配置に適しています。単一画像のリクエストでは `mask_url` で編集範囲を限定できます。`aspect_ratio` は 16 種類に対応し、構造化された `vgl` ドキュメントを渡したり再利用したりできます。

- Model id: `bria/fibo-2/edit`
- Made by: Bria AI
- Category: Image Editing
- Output: image
- Price: $0.04 / image (cheapest run $0.04 (40 API credits))
- Run: `POST https://api.doitong.com/v1/run/bria/fibo-2/edit`
- Quote: `POST https://api.doitong.com/v1/quote/bria/fibo-2/edit`
- Docs page: https://doitong.com/ja/developers/models/bria/fibo-2/edit

## Pricing

Price: **$0.04 / image**. Billed per generated image.

The full example input below costs $0.04 = 40 API credits (1 image × 40 API credits).

Prices are the upstream price in USD, paid from the API balance in API credits (1000 API credits = 1 USD). `POST https://api.doitong.com/v1/quote/bria/fibo-2/edit` with the same JSON body returns the exact price for that input; the quote is exactly what a run charges. Invalid input is never charged and failed or canceled requests are refunded automatically.

## Input parameters

Send either the canonical name or the native field name (not both). Canonical names are the same across models.

| Parameter | Canonical name | Type | Required | Default | Allowed values / range | Description |
|---|---|---|---|---|---|---|
| `image_urls` | `images` | array of image URL | yes |  | 1 – 4 items | 送信順に <image_1>、<image_2> などとしてインデックス付けされ、指示で使用する編集入力。ファイルまたはURLで1～4枚の画像を指定します。 |
| `instruction` |  | string \| null | no |  |  | 'vgl' と併せて指定した場合に 'vgl' を変更する編集指示。それ以外の場合は、自由形式のリクエストをVGLドキュメントに展開してレスポンスに含めます。 |
| `aspect_ratio` |  | enum (string) \| null | no |  | `1:1`, `1:2`, `1:3`, `1:4`, `1:5`, `2:1`, `2:3`, `3:1`, `3:2`, `3:4`, `4:1`, `4:3`, `4:5`, `5:1`, `5:4`, `9:16`, `9:21`, `10:16`, `16:9`, `16:10`, `21:9` | およそ1メガピクセルの出力に対するアスペクト比設定。入力画像が1枚の場合、この設定にかかわらず元の比率を保持します。複数入力では、省略すると1枚目の画像の比率を使用します。 |
| `seed` |  | integer | no | `5555` | 0 – 2,147,483,647 | 再現可能な結果のために乱数を制御するシード。0から2147483647までの範囲です。 |
| `mask_url` | `mask` | string (image URL) \| null | no |  |  | 画像1枚のリクエスト用編集マスク。画像と同じサイズのファイルまたはURLで指定します。白は再生成領域、黒はその他の領域を示します。結果は入力サイズを使用し、マスク外のピクセルを保持します。 |
| `vgl` |  | object {short_description, objects, background_setting, lighting, aesthetics, photographic_characteristics, style_medium, text_render, context, artistic_style, edit_instruction} \| null | no |  |  | 以前のレスポンスから再利用できるVGL（Visual Generation Language）ドキュメント。'instruction' と併せると1枚目の画像を表し、編集の基準になります。'instruction' がない場合は編集内容をそのまま指定し、'edit_instruction' を含める必要があります。 |
| `vgl.short_description` |  | string \| null | no |  |  | 意図する出力画像の簡潔な説明。 |
| `vgl.objects` |  | array of object {description, location, relationship, relative_size, shape_and_color, texture, appearance_details, number_of_objects, pose, expression, clothing, action, gender, skin_tone_and_texture, orientation} \| null | no | `[]` |  | 生成画像の内容をリストとして指定し、各オブジェクトの属性と、描画された他のオブジェクトとの関係を記録します。 |
| `vgl.objects[].description` |  | string \| null | no |  |  | 意図する出力オブジェクトの説明。 |
| `vgl.objects[].location` |  | string \| null | no |  |  | 画像内のオブジェクトの位置。 |
| `vgl.objects[].relationship` |  | string | yes |  |  | 画像内の他のオブジェクトとの関係。 |
| `vgl.objects[].relative_size` |  | string \| null | no |  |  | 画像に対するオブジェクトの相対サイズ。 |
| `vgl.objects[].shape_and_color` |  | string \| null | no |  |  | オブジェクトの形状と色。 |
| `vgl.objects[].texture` |  | string \| null | no |  |  | オブジェクトの質感。 |
| `vgl.objects[].appearance_details` |  | string \| null | no |  |  | オブジェクトの外観を説明する詳細。 |
| `vgl.objects[].number_of_objects` |  | integer \| null | no |  |  | 画像内のオブジェクト数。 |
| `vgl.objects[].pose` |  | string \| null | no |  |  | 描画されたオブジェクトのポーズ。 |
| `vgl.objects[].expression` |  | string \| null | no |  |  | 描画されたオブジェクトの表情。 |
| `vgl.objects[].clothing` |  | string \| null | no |  |  | 描画されたオブジェクトが着用する衣服。 |
| `vgl.objects[].action` |  | string \| null | no |  |  | 描画されたオブジェクトが行う動作。 |
| `vgl.objects[].gender` |  | string \| null | no |  |  | 描画されたオブジェクトの性別。 |
| `vgl.objects[].skin_tone_and_texture` |  | string \| null | no |  |  | 描画されたオブジェクトの肌の質感と色調。 |
| `vgl.objects[].orientation` |  | string \| null | no |  |  | 描画されたオブジェクトの向き。 |
| `vgl.background_setting` |  | string \| null | no |  |  | 生成画像の背景設定。 |
| `vgl.lighting` |  | object {conditions, direction, shadows} \| null | no |  |  | 生成画像の照明。 |
| `vgl.lighting.conditions` |  | string \| null | no |  |  | 生成画像の照明条件。 |
| `vgl.lighting.direction` |  | string \| null | no |  |  | 生成画像の照明方向。 |
| `vgl.lighting.shadows` |  | string \| null | no |  |  | 生成画像に描画する影。 |
| `vgl.aesthetics` |  | object {composition, color_scheme, mood_atmosphere} \| null | no |  |  | 生成画像の美的特性。 |
| `vgl.aesthetics.composition` |  | string \| null | no |  |  | 生成画像の構図。 |
| `vgl.aesthetics.color_scheme` |  | string \| null | no |  |  | 生成画像のカラーパレット。 |
| `vgl.aesthetics.mood_atmosphere` |  | string \| null | no |  |  | 生成画像の雰囲気と空気感。 |
| `vgl.photographic_characteristics` |  | object {depth_of_field, focus, camera_angle, lens_focal_length} \| null | no |  |  | 生成画像の写真特性。 |
| `vgl.photographic_characteristics.depth_of_field` |  | string \| null | no |  |  | 生成画像の被写界深度。 |
| `vgl.photographic_characteristics.focus` |  | string \| null | no |  |  | 生成画像の焦点。 |
| `vgl.photographic_characteristics.camera_angle` |  | string \| null | no |  |  | 生成画像のカメラアングル。 |
| `vgl.photographic_characteristics.lens_focal_length` |  | string \| null | no |  |  | 焦点距離で表す生成画像のレンズ設定。 |
| `vgl.style_medium` |  | string \| null | no |  |  | 生成画像の表現媒体。 |
| `vgl.text_render` |  | array of object {text, location, size, color, font, appearance_details} \| null | no | `[]` |  | 画像に含めるテキスト項目のリスト。 |
| `vgl.text_render[].text` |  | string | yes |  |  | 描画するテキスト。指定文言を正確に再現するため、fibo-2 に画像として視覚的にも提示されます。 |
| `vgl.text_render[].location` |  | string \| null | no |  |  | 画像内のテキスト配置。 |
| `vgl.text_render[].size` |  | string \| null | no |  |  | 画像内のテキストサイズ。 |
| `vgl.text_render[].color` |  | string \| null | no |  |  | テキストに使用する色。 |
| `vgl.text_render[].font` |  | string \| null | no |  |  | テキストのフォントスタイル。 |
| `vgl.text_render[].appearance_details` |  | string \| null | no |  |  | テキストの外観に関するその他の注目すべき詳細。 |
| `vgl.context` |  | string \| null | no |  |  | 生成画像のコンテキスト。 |
| `vgl.artistic_style` |  | string \| null | no |  |  | 生成画像の芸術的スタイル。 |
| `vgl.edit_instruction` |  | string \| null | no |  |  | 画像の編集方法を説明する指示。 |

File parameters (`images`, `mask`) take a public `https://` URL, a `data:` URI up to 10 MB, or the `file_url` of an upload from `POST /files`.

## Example input

Required parameters only:

```json
{
  "images": [
    "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  ]
}
```

A fuller example:

```json
{
  "image_urls": [
    "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  ]
}
```

## Run it

Set `DOITONG_API_KEY` to a key from https://doitong.com/developers/dashboard#keys. `?wait=20` returns the finished request in the same call when it is ready within 20 seconds; otherwise poll `GET /requests/{id}` (it also accepts `?wait=`), or pass `webhook_url`.

### curl

```bash
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/bria/fibo-2/edit?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image_urls": [
      "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
    ]
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"
```

### JavaScript

```javascript
const API = "https://api.doitong.com/v1";
const headers = {
  "Authorization": "Bearer " + process.env.DOITONG_API_KEY,
  "Content-Type": "application/json",
};

// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/bria/fibo-2/edit?wait=20", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "image_urls": [
      "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
    ]
  }),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);

// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
  res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
  request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
```

### Python

```python
import os
import requests

API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}

payload = {
    "image_urls": [
        "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
    ],
}

# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/bria/fibo-2/edit", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
    raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])

# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
    request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
    raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
```

### MCP

The MCP server at `https://api.doitong.com/v1/mcp` exposes the tools `search_models`, `get_model`, `quote`, `run`, `get_request`, `cancel_request`, `list_requests`, `create_upload` and `get_account`. A `run` call for this model:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "run",
    "arguments": {
      "model_id": "bria/fibo-2/edit",
      "input": {
        "image_urls": [
          "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
        ]
      },
      "wait_seconds": 20
    }
  }
}
```

## Response

Every call returns a request object. `status` is one of `queued`, `running`, `succeeded`, `failed`, `canceled`. `outputs` lists the generated files with URLs on our storage (kept forever, or 7 days with `?storage=temporary`; `storage` says which); `output` is the model's own result object with the same URLs.

```json
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "bria/fibo-2/edit",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 40,
    "usd": "0.04",
    "charged": 40,
    "refunded": 0
  },
  "input": {
    "image_urls": [
      "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
    ]
  },
  "output": {
    "image": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768
    },
    "images": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200,
        "width": 1024,
        "height": 768
      }
    ],
    "vgl": {}
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
```

### Output fields (`output`)

| Field | Type | Description |
|---|---|---|
| `image` | object {url, content_type, file_name, file_size, width, height} | 編集結果の画像。 |
| `images` | array of object {url, content_type, file_name, file_size, width, height} | 他のFIBOアプリが返す形式に一致する画像リスト。唯一の項目は同じ画像です。 |
| `vgl` | object | 編集に使用したVGL。`edit_instruction` を含みます。 |

## Related models

- [Fibo 2.0 Generate](https://doitong.com/developers/models/bria/fibo-2/generate.md) (`bria/fibo-2/generate`): $0.04 / image
- [FLUX.1 Kontext \[pro\]](https://doitong.com/developers/models/flux-pro/kontext.md) (`flux-pro/kontext`): $0.04 / image
- [GPT Image 2.5 Edit](https://doitong.com/developers/models/openai/gpt-image-2.5/flare/edit.md) (`openai/gpt-image-2.5/flare/edit`): from $0.12 / image
- [Nano Banana 2 Edit](https://doitong.com/developers/models/nano-banana-2/edit.md) (`nano-banana-2/edit`): from $0.06 / image
- [Nano Banana Pro Edit](https://doitong.com/developers/models/nano-banana-pro/edit.md) (`nano-banana-pro/edit`): from $0.15 / image
- [Qwen Image 3 Edit](https://doitong.com/developers/models/alibaba/qwen-image-3/edit.md) (`alibaba/qwen-image-3/edit`): from $0.04 / image
- [Seedream 5.0 Pro Edit](https://doitong.com/developers/models/bytedance/seedream/v5/pro/edit.md) (`bytedance/seedream/v5/pro/edit`): from $0.0675 / run of output image
- [Bria](https://doitong.com/developers/models/bria/reimagine.md) (`bria/reimagine`): $0.04 / image

## Links

- HTML page: https://doitong.com/developers/models/bria/fibo-2/edit
- All models and guides for AI agents: https://doitong.com/developers/llms.txt
- OpenAPI 3.1 with this model's typed request body: https://doitong.com/developers/openapi.json?model=bria/fibo-2/edit
- Errors: https://doitong.com/developers/docs/errors
- Model details as JSON: https://api.doitong.com/v1/models/bria/fibo-2/edit
