# Replicate

OpenAPI spec: [https://api.payweave.app/app/app_ctebrle3jqxlzymbyukeadqr/openapi.json](https://api.payweave.app/app/app_ctebrle3jqxlzymbyukeadqr/openapi.json)

## Networks

| Name | Mode | CAIP-2 | Chain ID / Cluster | Protocols |
|---|---|---|---|---|
| Tempo Mainnet | live | `eip155:4217` | 4217 | mpp |
| Solana Mainnet | live | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` | mainnet-beta | mpp, x402 |
| Base | live | `eip155:8453` | 8453 | x402 |

## Accepted Currencies

| Symbol | Name | Decimals | Network | Address | Protocols |
|---|---|---|---|---|---|
| USDC.e | Bridged USDC (Stargate) | 6 | `eip155:4217` | `0x20c000000000000000000000b9537d11c60e8b50` | mpp |
| USDC | USD Coin (Solana) | 6 | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` | `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v` | mpp, x402 |
| USDC | USD Coin | 6 | `eip155:8453` | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` | x402 |

## Endpoints (40)

### Replicate: black-forest-labs/flux-1.1-pro

BFL flagship. Best quality/speed balance for production work.

- Method: POST
- Path: `/models/black-forest-labs/flux-1.1-pro/predictions`
- Price: $0.08000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "16:9",
            "9:16",
            "4:3",
            "3:4",
            "21:9",
            "9:21",
            "3:2",
            "2:3",
            "4:5",
            "5:4",
            "16:10",
            "10:16"
          ]
        },
        "image_prompt": {
          "type": "string",
          "format": "uri"
        },
        "width": {
          "type": "integer",
          "minimum": 256,
          "maximum": 1440
        },
        "height": {
          "type": "integer",
          "minimum": 256,
          "maximum": 1440
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "jpg",
            "png"
          ]
        },
        "output_quality": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "safety_tolerance": {
          "type": "integer",
          "minimum": 1,
          "maximum": 6,
          "description": "Content safety strictness; 1=strictest, 6=most permissive. Default: 2."
        },
        "prompt_upsampling": {
          "type": "boolean"
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-1.1-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "image_prompt": "https://example.com"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-1.1-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "image_prompt": "https://example.com"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/black-forest-labs/flux-1.1-pro/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","image_prompt":"https://example.com"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/black-forest-labs/flux-1.1-pro/predictions" -X POST --json '{"input":{"prompt":"","aspect_ratio":"1:1","image_prompt":"https://example.com"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/black-forest-labs/flux-1.1-pro/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","image_prompt":"https://example.com"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-1.1-pro/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","image_prompt":"https://example.com"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/black-forest-labs/flux-1.1-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "image_prompt": "https://example.com"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-1.1-pro/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","image_prompt":"https://example.com"}}' -p x402
```

### Replicate: black-forest-labs/flux-1.1-pro-ultra

BFL flagship at 4MP output. For posters, prints, and high-detail use.

- Method: POST
- Path: `/models/black-forest-labs/flux-1.1-pro-ultra/predictions`
- Price: $0.12000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "16:9",
            "9:16",
            "4:3",
            "3:4",
            "21:9",
            "9:21",
            "3:2",
            "2:3"
          ]
        },
        "image_prompt": {
          "type": "string",
          "format": "uri"
        },
        "image_prompt_strength": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "raw": {
          "type": "boolean",
          "description": "Skip prompt enhancement for more literal interpretation."
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "jpg",
            "png"
          ]
        },
        "safety_tolerance": {
          "type": "integer",
          "minimum": 1,
          "maximum": 6,
          "description": "Content safety strictness; 1=strictest, 6=most permissive. Default: 2."
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-1.1-pro-ultra/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "image_prompt": "https://example.com"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-1.1-pro-ultra/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "image_prompt": "https://example.com"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/black-forest-labs/flux-1.1-pro-ultra/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","image_prompt":"https://example.com"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/black-forest-labs/flux-1.1-pro-ultra/predictions" -X POST --json '{"input":{"prompt":"","aspect_ratio":"1:1","image_prompt":"https://example.com"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/black-forest-labs/flux-1.1-pro-ultra/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","image_prompt":"https://example.com"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-1.1-pro-ultra/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","image_prompt":"https://example.com"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/black-forest-labs/flux-1.1-pro-ultra/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "image_prompt": "https://example.com"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-1.1-pro-ultra/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","image_prompt":"https://example.com"}}' -p x402
```

### Replicate: black-forest-labs/flux-2-flex

Black Forest Labs FLUX 2 Flex. Max-quality with tunable steps/guidance and up to 4 reference images, ≤2 MP output through this route.

- Method: POST
- Path: `/models/black-forest-labs/flux-2-flex/predictions`
- Price: $0.74000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "input_images": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 4,
          "description": "Up to 4 reference images. Upstream allows 10; capped here for cost control."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "match_input_image",
            "1:1",
            "16:9",
            "3:2",
            "2:3",
            "4:5",
            "5:4",
            "9:16",
            "3:4",
            "4:3"
          ]
        },
        "resolution": {
          "type": "string",
          "enum": [
            "0.5 MP",
            "1 MP",
            "2 MP"
          ],
          "description": "Output resolution. Capped at 2 MP for flat pricing. Default 1 MP."
        },
        "steps": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50,
          "description": "Inference steps (1-50). Default 30."
        },
        "guidance": {
          "type": "number",
          "minimum": 1.5,
          "maximum": 10,
          "description": "Prompt adherence (1.5-10). Default 4.5."
        },
        "prompt_upsampling": {
          "type": "boolean",
          "description": "Auto-rewrite the prompt for more creative output. Default true."
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "jpg",
            "png"
          ]
        },
        "output_quality": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "safety_tolerance": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-2-flex/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "match_input_image"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-2-flex/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "match_input_image"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/black-forest-labs/flux-2-flex/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"match_input_image"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/black-forest-labs/flux-2-flex/predictions" -X POST --json '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"match_input_image"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/black-forest-labs/flux-2-flex/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"match_input_image"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-2-flex/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"match_input_image"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/black-forest-labs/flux-2-flex/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "match_input_image"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-2-flex/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"match_input_image"}}' -p x402
```

### Replicate: black-forest-labs/flux-2-klein-4b

Black Forest Labs FLUX 2 Klein 4B. Sub-second distilled FLUX. Cheap-and-fast tier; ≤2 MP output and ≤4 reference images through this route.

- Method: POST
- Path: `/models/black-forest-labs/flux-2-klein-4b/predictions`
- Price: $0.02000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "images": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 4,
          "description": "Up to 4 reference images. Upstream allows 5; capped here for cost control."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "16:9",
            "9:16",
            "3:2",
            "2:3",
            "4:3",
            "3:4",
            "5:4",
            "4:5",
            "21:9",
            "9:21",
            "match_input_image"
          ]
        },
        "output_megapixels": {
          "type": "string",
          "enum": [
            "0.25",
            "0.5",
            "1",
            "2"
          ],
          "description": "Output resolution in MP. Capped at 2 for flat pricing. Default 1."
        },
        "go_fast": {
          "type": "boolean",
          "description": "Additional speed optimizations. Default false."
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "jpg",
            "png"
          ]
        },
        "output_quality": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "disable_safety_checker": {
          "type": "boolean"
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-2-klein-4b/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-2-klein-4b/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/black-forest-labs/flux-2-klein-4b/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/black-forest-labs/flux-2-klein-4b/predictions" -X POST --json '{"input":{"prompt":"","images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/black-forest-labs/flux-2-klein-4b/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-2-klein-4b/predictions" -m POST -b '{"input":{"prompt":"","images":["https://example.com"],"aspect_ratio":"1:1"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/black-forest-labs/flux-2-klein-4b/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-2-klein-4b/predictions" -m POST -b '{"input":{"prompt":"","images":["https://example.com"],"aspect_ratio":"1:1"}}' -p x402
```

### Replicate: black-forest-labs/flux-2-max

Black Forest Labs FLUX 2 Max. Highest-fidelity FLUX. Multi-image conditioning (up to 4 refs) and ≤2 MP output through this route.

- Method: POST
- Path: `/models/black-forest-labs/flux-2-max/predictions`
- Price: $0.45000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "input_images": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 4,
          "description": "Up to 4 reference images for image-to-image. jpeg, png, gif, or webp."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "match_input_image",
            "1:1",
            "16:9",
            "3:2",
            "2:3",
            "4:5",
            "5:4",
            "9:16",
            "3:4",
            "4:3"
          ]
        },
        "resolution": {
          "type": "string",
          "enum": [
            "0.5 MP",
            "1 MP",
            "2 MP"
          ],
          "description": "Output resolution. Capped at 2 MP for flat pricing. Default 1 MP."
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "jpg",
            "png"
          ]
        },
        "output_quality": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "safety_tolerance": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-2-max/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "match_input_image"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-2-max/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "match_input_image"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/black-forest-labs/flux-2-max/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"match_input_image"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/black-forest-labs/flux-2-max/predictions" -X POST --json '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"match_input_image"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/black-forest-labs/flux-2-max/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"match_input_image"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-2-max/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"match_input_image"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/black-forest-labs/flux-2-max/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "match_input_image"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-2-max/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"match_input_image"}}' -p x402
```

### Replicate: black-forest-labs/flux-2-pro

Black Forest Labs FLUX 2 Pro. High-quality generation and editing with up to 4 reference images, ≤2 MP output through this route.

- Method: POST
- Path: `/models/black-forest-labs/flux-2-pro/predictions`
- Price: $0.22000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "input_images": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 4,
          "description": "Up to 4 reference images for image-to-image. jpeg, png, gif, or webp."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "match_input_image",
            "1:1",
            "16:9",
            "3:2",
            "2:3",
            "4:5",
            "5:4",
            "9:16",
            "3:4",
            "4:3"
          ]
        },
        "resolution": {
          "type": "string",
          "enum": [
            "0.5 MP",
            "1 MP",
            "2 MP"
          ],
          "description": "Output resolution. Capped at 2 MP for flat pricing. Default 1 MP."
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "jpg",
            "png"
          ]
        },
        "output_quality": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "safety_tolerance": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-2-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "match_input_image"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-2-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "match_input_image"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/black-forest-labs/flux-2-pro/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"match_input_image"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/black-forest-labs/flux-2-pro/predictions" -X POST --json '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"match_input_image"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/black-forest-labs/flux-2-pro/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"match_input_image"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-2-pro/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"match_input_image"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/black-forest-labs/flux-2-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "match_input_image"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-2-pro/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"match_input_image"}}' -p x402
```

### Replicate: black-forest-labs/flux-dev

FLUX Dev (open weights). Better quality than schnell, slower.

- Method: POST
- Path: `/models/black-forest-labs/flux-dev/predictions`
- Price: $0.05000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "16:9",
            "9:16",
            "4:3",
            "3:4",
            "21:9",
            "9:21",
            "3:2",
            "2:3",
            "4:5",
            "5:4",
            "16:10",
            "10:16"
          ]
        },
        "image": {
          "type": "string",
          "format": "uri",
          "description": "Optional input image for img2img."
        },
        "prompt_strength": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "num_outputs": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4
        },
        "num_inference_steps": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50
        },
        "guidance": {
          "type": "number",
          "minimum": 0,
          "maximum": 10
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "jpg",
            "png"
          ]
        },
        "output_quality": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "megapixels": {
          "type": "string",
          "enum": [
            "0.25",
            "1"
          ]
        },
        "disable_safety_checker": {
          "type": "boolean"
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-dev/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "image": "https://example.com"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-dev/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "image": "https://example.com"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/black-forest-labs/flux-dev/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","image":"https://example.com"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/black-forest-labs/flux-dev/predictions" -X POST --json '{"input":{"prompt":"","aspect_ratio":"1:1","image":"https://example.com"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/black-forest-labs/flux-dev/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","image":"https://example.com"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-dev/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","image":"https://example.com"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/black-forest-labs/flux-dev/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "image": "https://example.com"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-dev/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","image":"https://example.com"}}' -p x402
```

### Replicate: black-forest-labs/flux-fill-pro

Inpainting with mask. Replace a masked region while preserving the rest.

- Method: POST
- Path: `/models/black-forest-labs/flux-fill-pro/predictions`
- Price: $0.10000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "image": {
          "type": "string",
          "format": "uri",
          "description": "Image to inpaint."
        },
        "mask": {
          "type": "string",
          "format": "uri",
          "description": "Mask image; white pixels mark the inpaint area."
        },
        "steps": {
          "type": "integer",
          "minimum": 15,
          "maximum": 50
        },
        "guidance": {
          "type": "number",
          "minimum": 1.5,
          "maximum": 100
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "jpg",
            "png"
          ]
        },
        "safety_tolerance": {
          "type": "integer",
          "minimum": 1,
          "maximum": 6,
          "description": "Content safety strictness; 1=strictest, 6=most permissive. Default: 2."
        },
        "prompt_upsampling": {
          "type": "boolean"
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt",
        "image",
        "mask"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-fill-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image": "https://example.com",
      "mask": "https://example.com"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-fill-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image": "https://example.com",
      "mask": "https://example.com"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/black-forest-labs/flux-fill-pro/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image":"https://example.com","mask":"https://example.com"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/black-forest-labs/flux-fill-pro/predictions" -X POST --json '{"input":{"prompt":"","image":"https://example.com","mask":"https://example.com"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/black-forest-labs/flux-fill-pro/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image":"https://example.com","mask":"https://example.com"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-fill-pro/predictions" -m POST -b '{"input":{"prompt":"","image":"https://example.com","mask":"https://example.com"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/black-forest-labs/flux-fill-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image": "https://example.com",
      "mask": "https://example.com"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-fill-pro/predictions" -m POST -b '{"input":{"prompt":"","image":"https://example.com","mask":"https://example.com"}}' -p x402
```

### Replicate: black-forest-labs/flux-kontext-max

Premium kontext editing. Higher fidelity for complex multi-region edits.

- Method: POST
- Path: `/models/black-forest-labs/flux-kontext-max/predictions`
- Price: $0.16000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "input_image": {
          "type": "string",
          "format": "uri",
          "description": "Image to edit. Omit for text-to-image generation."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "match_input_image",
            "1:1",
            "16:9",
            "9:16",
            "4:3",
            "3:4",
            "3:2",
            "2:3",
            "21:9",
            "9:21"
          ]
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "jpg",
            "png"
          ]
        },
        "safety_tolerance": {
          "type": "integer",
          "minimum": 1,
          "maximum": 6,
          "description": "Content safety strictness; 1=strictest, 6=most permissive. Default: 2."
        },
        "prompt_upsampling": {
          "type": "boolean"
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-kontext-max/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_image": "https://example.com",
      "aspect_ratio": "match_input_image"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-kontext-max/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_image": "https://example.com",
      "aspect_ratio": "match_input_image"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/black-forest-labs/flux-kontext-max/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_image":"https://example.com","aspect_ratio":"match_input_image"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/black-forest-labs/flux-kontext-max/predictions" -X POST --json '{"input":{"prompt":"","input_image":"https://example.com","aspect_ratio":"match_input_image"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/black-forest-labs/flux-kontext-max/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_image":"https://example.com","aspect_ratio":"match_input_image"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-kontext-max/predictions" -m POST -b '{"input":{"prompt":"","input_image":"https://example.com","aspect_ratio":"match_input_image"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/black-forest-labs/flux-kontext-max/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_image": "https://example.com",
      "aspect_ratio": "match_input_image"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-kontext-max/predictions" -m POST -b '{"input":{"prompt":"","input_image":"https://example.com","aspect_ratio":"match_input_image"}}' -p x402
```

### Replicate: black-forest-labs/flux-kontext-pro

Instruction-based image editing. "Change the background to a snowy mountain."

- Method: POST
- Path: `/models/black-forest-labs/flux-kontext-pro/predictions`
- Price: $0.08000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "input_image": {
          "type": "string",
          "format": "uri",
          "description": "Image to edit. Omit for text-to-image generation."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "match_input_image",
            "1:1",
            "16:9",
            "9:16",
            "4:3",
            "3:4",
            "3:2",
            "2:3",
            "21:9",
            "9:21"
          ]
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "jpg",
            "png"
          ]
        },
        "safety_tolerance": {
          "type": "integer",
          "minimum": 1,
          "maximum": 6,
          "description": "Content safety strictness; 1=strictest, 6=most permissive. Default: 2."
        },
        "prompt_upsampling": {
          "type": "boolean"
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-kontext-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_image": "https://example.com",
      "aspect_ratio": "match_input_image"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-kontext-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_image": "https://example.com",
      "aspect_ratio": "match_input_image"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/black-forest-labs/flux-kontext-pro/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_image":"https://example.com","aspect_ratio":"match_input_image"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/black-forest-labs/flux-kontext-pro/predictions" -X POST --json '{"input":{"prompt":"","input_image":"https://example.com","aspect_ratio":"match_input_image"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/black-forest-labs/flux-kontext-pro/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_image":"https://example.com","aspect_ratio":"match_input_image"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-kontext-pro/predictions" -m POST -b '{"input":{"prompt":"","input_image":"https://example.com","aspect_ratio":"match_input_image"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/black-forest-labs/flux-kontext-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_image": "https://example.com",
      "aspect_ratio": "match_input_image"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-kontext-pro/predictions" -m POST -b '{"input":{"prompt":"","input_image":"https://example.com","aspect_ratio":"match_input_image"}}' -p x402
```

### Replicate: black-forest-labs/flux-schnell

Fastest FLUX. ~2s per image. Cheap drafts and high-volume gen.

- Method: POST
- Path: `/models/black-forest-labs/flux-schnell/predictions`
- Price: $0.01000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "16:9",
            "9:16",
            "4:3",
            "3:4",
            "21:9",
            "9:21",
            "3:2",
            "2:3",
            "4:5",
            "5:4",
            "16:10",
            "10:16"
          ]
        },
        "num_outputs": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4
        },
        "num_inference_steps": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4,
          "description": "Default 4. Lower = faster, less detail."
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "jpg",
            "png"
          ]
        },
        "output_quality": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "megapixels": {
          "type": "string",
          "enum": [
            "0.25",
            "1"
          ]
        },
        "disable_safety_checker": {
          "type": "boolean"
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-schnell/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "num_outputs": 1
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/black-forest-labs/flux-schnell/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "num_outputs": 1
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/black-forest-labs/flux-schnell/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","num_outputs":1}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/black-forest-labs/flux-schnell/predictions" -X POST --json '{"input":{"prompt":"","aspect_ratio":"1:1","num_outputs":1}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/black-forest-labs/flux-schnell/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","num_outputs":1}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-schnell/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","num_outputs":1}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/black-forest-labs/flux-schnell/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "num_outputs": 1
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/black-forest-labs/flux-schnell/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","num_outputs":1}}' -p x402
```

### Replicate: bytedance/seedream-3

ByteDance Seedream 3. Text-to-image at native 2K. Tight guidance control via guidance_scale.

- Method: POST
- Path: `/models/bytedance/seedream-3/predictions`
- Price: $0.06000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "3:4",
            "4:3",
            "16:9",
            "9:16",
            "2:3",
            "3:2",
            "21:9",
            "custom"
          ]
        },
        "size": {
          "type": "string",
          "enum": [
            "small",
            "regular",
            "big"
          ],
          "description": "big=2048px longest, regular=1MP, small=512px shortest. Ignored if aspect_ratio=custom."
        },
        "width": {
          "type": "integer",
          "minimum": 512,
          "maximum": 2048
        },
        "height": {
          "type": "integer",
          "minimum": 512,
          "maximum": 2048
        },
        "guidance_scale": {
          "type": "number",
          "minimum": 1,
          "maximum": 10,
          "description": "Prompt adherence (1-10). Default 2.5."
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/bytedance/seedream-3/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "size": "small"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/bytedance/seedream-3/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "size": "small"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/bytedance/seedream-3/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","size":"small"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/bytedance/seedream-3/predictions" -X POST --json '{"input":{"prompt":"","aspect_ratio":"1:1","size":"small"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/bytedance/seedream-3/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","size":"small"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/bytedance/seedream-3/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","size":"small"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/bytedance/seedream-3/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "size": "small"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/bytedance/seedream-3/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","size":"small"}}' -p x402
```

### Replicate: bytedance/seedream-4.5

ByteDance Seedream 4.5. Strong spatial reasoning and world knowledge. 2K/4K output, up to 14 reference images for multi-image conditioning.

- Method: POST
- Path: `/models/bytedance/seedream-4.5/predictions`
- Price: $0.08000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "image_input": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "minItems": 1,
          "maxItems": 14,
          "description": "Reference images for image-to-image (1-14)."
        },
        "size": {
          "type": "string",
          "enum": [
            "2K",
            "4K"
          ],
          "description": "Output resolution. 2K (default) or 4K. Same price either way."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "match_input_image",
            "1:1",
            "4:3",
            "3:4",
            "16:9",
            "9:16",
            "3:2",
            "2:3",
            "21:9"
          ]
        },
        "disable_safety_checker": {
          "type": "boolean"
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/bytedance/seedream-4.5/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "size": "2K"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/bytedance/seedream-4.5/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "size": "2K"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/bytedance/seedream-4.5/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image_input":["https://example.com"],"size":"2K"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/bytedance/seedream-4.5/predictions" -X POST --json '{"input":{"prompt":"","image_input":["https://example.com"],"size":"2K"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/bytedance/seedream-4.5/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image_input":["https://example.com"],"size":"2K"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/bytedance/seedream-4.5/predictions" -m POST -b '{"input":{"prompt":"","image_input":["https://example.com"],"size":"2K"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/bytedance/seedream-4.5/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "size": "2K"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/bytedance/seedream-4.5/predictions" -m POST -b '{"input":{"prompt":"","image_input":["https://example.com"],"size":"2K"}}' -p x402
```

### Replicate: bytedance/seedream-4

ByteDance Seedream 4. Unified text-to-image + single-sentence editing at up to 4K. Up to 10 reference images.

- Method: POST
- Path: `/models/bytedance/seedream-4/predictions`
- Price: $0.06000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "image_input": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "minItems": 1,
          "maxItems": 10,
          "description": "Reference images for image-to-image (1-10)."
        },
        "size": {
          "type": "string",
          "enum": [
            "1K",
            "2K",
            "4K",
            "custom"
          ],
          "description": "Output resolution. Use 'custom' with width/height for exact dimensions."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "match_input_image",
            "1:1",
            "4:3",
            "3:4",
            "16:9",
            "9:16",
            "3:2",
            "2:3",
            "21:9"
          ]
        },
        "width": {
          "type": "integer",
          "minimum": 1024,
          "maximum": 4096,
          "description": "Only used when size='custom'."
        },
        "height": {
          "type": "integer",
          "minimum": 1024,
          "maximum": 4096,
          "description": "Only used when size='custom'."
        },
        "enhance_prompt": {
          "type": "boolean",
          "description": "Auto-rewrite prompt for higher quality (slower). Default true."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/bytedance/seedream-4/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "size": "1K"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/bytedance/seedream-4/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "size": "1K"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/bytedance/seedream-4/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image_input":["https://example.com"],"size":"1K"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/bytedance/seedream-4/predictions" -X POST --json '{"input":{"prompt":"","image_input":["https://example.com"],"size":"1K"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/bytedance/seedream-4/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image_input":["https://example.com"],"size":"1K"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/bytedance/seedream-4/predictions" -m POST -b '{"input":{"prompt":"","image_input":["https://example.com"],"size":"1K"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/bytedance/seedream-4/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "size": "1K"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/bytedance/seedream-4/predictions" -m POST -b '{"input":{"prompt":"","image_input":["https://example.com"],"size":"1K"}}' -p x402
```

### Replicate: bytedance/seedream-5-lite

ByteDance Seedream 5.0 Lite. Image gen with built-in reasoning and example-based editing. 2K/3K output, up to 14 reference images.

- Method: POST
- Path: `/models/bytedance/seedream-5-lite/predictions`
- Price: $0.07000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "image_input": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "minItems": 1,
          "maxItems": 14,
          "description": "Reference images for image-to-image (1-14)."
        },
        "size": {
          "type": "string",
          "enum": [
            "2K",
            "3K"
          ],
          "description": "Output resolution. 2K (default) or 3K. Same price either way."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "match_input_image",
            "1:1",
            "4:3",
            "3:4",
            "16:9",
            "9:16",
            "3:2",
            "2:3",
            "21:9"
          ]
        },
        "output_format": {
          "type": "string",
          "enum": [
            "png",
            "jpeg"
          ]
        },
        "return_byteplus_urls": {
          "type": "boolean",
          "description": "Return raw BytePlus URLs (24h TTL) for trusted handoff to Seedance 2.0."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/bytedance/seedream-5-lite/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "size": "2K"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/bytedance/seedream-5-lite/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "size": "2K"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/bytedance/seedream-5-lite/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image_input":["https://example.com"],"size":"2K"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/bytedance/seedream-5-lite/predictions" -X POST --json '{"input":{"prompt":"","image_input":["https://example.com"],"size":"2K"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/bytedance/seedream-5-lite/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image_input":["https://example.com"],"size":"2K"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/bytedance/seedream-5-lite/predictions" -m POST -b '{"input":{"prompt":"","image_input":["https://example.com"],"size":"2K"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/bytedance/seedream-5-lite/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "size": "2K"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/bytedance/seedream-5-lite/predictions" -m POST -b '{"input":{"prompt":"","image_input":["https://example.com"],"size":"2K"}}' -p x402
```

### Replicate: google/imagen-4-fast

Google Imagen 4 fast tier. Drafts and rapid iteration.

- Method: POST
- Path: `/models/google/imagen-4-fast/predictions`
- Price: $0.04000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "16:9",
            "9:16",
            "4:3",
            "3:4"
          ]
        },
        "output_format": {
          "type": "string",
          "enum": [
            "jpg",
            "png"
          ]
        },
        "safety_filter_level": {
          "type": "string",
          "enum": [
            "block_low_and_above",
            "block_medium_and_above",
            "block_only_high"
          ]
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/google/imagen-4-fast/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "output_format": "jpg"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/google/imagen-4-fast/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "output_format": "jpg"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/google/imagen-4-fast/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","output_format":"jpg"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/google/imagen-4-fast/predictions" -X POST --json '{"input":{"prompt":"","aspect_ratio":"1:1","output_format":"jpg"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/google/imagen-4-fast/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","output_format":"jpg"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/google/imagen-4-fast/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","output_format":"jpg"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/google/imagen-4-fast/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "output_format": "jpg"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/google/imagen-4-fast/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","output_format":"jpg"}}' -p x402
```

### Replicate: google/imagen-4

Google Imagen 4 standard. Production-quality general image gen. Supports 1K/2K output.

- Method: POST
- Path: `/models/google/imagen-4/predictions`
- Price: $0.08000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "16:9",
            "9:16",
            "4:3",
            "3:4"
          ]
        },
        "image_size": {
          "type": "string",
          "enum": [
            "1K",
            "2K"
          ],
          "description": "Output resolution. Default 1K. Replicate bills the same per image at either size."
        },
        "output_format": {
          "type": "string",
          "enum": [
            "jpg",
            "png"
          ]
        },
        "safety_filter_level": {
          "type": "string",
          "enum": [
            "block_low_and_above",
            "block_medium_and_above",
            "block_only_high"
          ]
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/google/imagen-4/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "image_size": "1K"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/google/imagen-4/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "image_size": "1K"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/google/imagen-4/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","image_size":"1K"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/google/imagen-4/predictions" -X POST --json '{"input":{"prompt":"","aspect_ratio":"1:1","image_size":"1K"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/google/imagen-4/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","image_size":"1K"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/google/imagen-4/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","image_size":"1K"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/google/imagen-4/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "image_size": "1K"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/google/imagen-4/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","image_size":"1K"}}' -p x402
```

### Replicate: google/imagen-4-ultra

Google Imagen 4 ultra. Skin texture, fabric weave, fine detail. Supports 1K/2K output.

- Method: POST
- Path: `/models/google/imagen-4-ultra/predictions`
- Price: $0.12000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "16:9",
            "9:16",
            "4:3",
            "3:4"
          ]
        },
        "image_size": {
          "type": "string",
          "enum": [
            "1K",
            "2K"
          ],
          "description": "Output resolution. Default 1K. Replicate bills the same per image at either size."
        },
        "output_format": {
          "type": "string",
          "enum": [
            "jpg",
            "png"
          ]
        },
        "safety_filter_level": {
          "type": "string",
          "enum": [
            "block_low_and_above",
            "block_medium_and_above",
            "block_only_high"
          ]
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/google/imagen-4-ultra/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "image_size": "1K"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/google/imagen-4-ultra/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "image_size": "1K"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/google/imagen-4-ultra/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","image_size":"1K"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/google/imagen-4-ultra/predictions" -X POST --json '{"input":{"prompt":"","aspect_ratio":"1:1","image_size":"1K"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/google/imagen-4-ultra/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","image_size":"1K"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/google/imagen-4-ultra/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","image_size":"1K"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/google/imagen-4-ultra/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "image_size": "1K"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/google/imagen-4-ultra/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","image_size":"1K"}}' -p x402
```

### Replicate: google/nano-banana-2-2k

Nano Banana 2 at 2K. Same model, higher-resolution output for print previews and social hero images.

- Method: POST
- Path: `/models/google/nano-banana-2-2k/predictions`
- Price: $0.22000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "image_input": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 14,
          "description": "Up to 14 reference images for editing, multi-image fusion, or character consistency."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "2:3",
            "3:2",
            "3:4",
            "4:3",
            "4:5",
            "5:4",
            "9:16",
            "16:9",
            "21:9",
            "1:4",
            "4:1",
            "1:8",
            "8:1"
          ]
        },
        "match_input_image": {
          "type": "boolean",
          "description": "If true, output matches the first input image's aspect ratio (overrides aspect_ratio)."
        },
        "output_format": {
          "type": "string",
          "enum": [
            "jpg",
            "png"
          ]
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/google/nano-banana-2-2k/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/google/nano-banana-2-2k/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/google/nano-banana-2-2k/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/google/nano-banana-2-2k/predictions" -X POST --json '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/google/nano-banana-2-2k/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/google/nano-banana-2-2k/predictions" -m POST -b '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/google/nano-banana-2-2k/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/google/nano-banana-2-2k/predictions" -m POST -b '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}' -p x402
```

### Replicate: google/nano-banana-2-4k

Nano Banana 2 at 4K. Premium tier for posters, prints, and detail-critical assets.

- Method: POST
- Path: `/models/google/nano-banana-2-4k/predictions`
- Price: $0.32000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "image_input": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 14,
          "description": "Up to 14 reference images for editing, multi-image fusion, or character consistency."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "2:3",
            "3:2",
            "3:4",
            "4:3",
            "4:5",
            "5:4",
            "9:16",
            "16:9",
            "21:9",
            "1:4",
            "4:1",
            "1:8",
            "8:1"
          ]
        },
        "match_input_image": {
          "type": "boolean",
          "description": "If true, output matches the first input image's aspect ratio (overrides aspect_ratio)."
        },
        "output_format": {
          "type": "string",
          "enum": [
            "jpg",
            "png"
          ]
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/google/nano-banana-2-4k/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/google/nano-banana-2-4k/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/google/nano-banana-2-4k/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/google/nano-banana-2-4k/predictions" -X POST --json '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/google/nano-banana-2-4k/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/google/nano-banana-2-4k/predictions" -m POST -b '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/google/nano-banana-2-4k/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/google/nano-banana-2-4k/predictions" -m POST -b '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}' -p x402
```

### Replicate: google/nano-banana-2

Google Nano Banana 2 (Gemini 3.1 Flash Image) at 1K. Fast text-to-image and conversational editing; accepts up to 14 reference images.

- Method: POST
- Path: `/models/google/nano-banana-2/predictions`
- Price: $0.14000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "image_input": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 14,
          "description": "Up to 14 reference images for editing, multi-image fusion, or character consistency."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "2:3",
            "3:2",
            "3:4",
            "4:3",
            "4:5",
            "5:4",
            "9:16",
            "16:9",
            "21:9",
            "1:4",
            "4:1",
            "1:8",
            "8:1"
          ]
        },
        "match_input_image": {
          "type": "boolean",
          "description": "If true, output matches the first input image's aspect ratio (overrides aspect_ratio)."
        },
        "output_format": {
          "type": "string",
          "enum": [
            "jpg",
            "png"
          ]
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/google/nano-banana-2/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/google/nano-banana-2/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/google/nano-banana-2/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/google/nano-banana-2/predictions" -X POST --json '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/google/nano-banana-2/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/google/nano-banana-2/predictions" -m POST -b '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/google/nano-banana-2/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/google/nano-banana-2/predictions" -m POST -b '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}' -p x402
```

### Replicate: google/nano-banana-pro-4k

Nano Banana Pro at 4K. Highest-fidelity tier — posters, prints, and detail-critical hero imagery.

- Method: POST
- Path: `/models/google/nano-banana-pro-4k/predictions`
- Price: $0.50000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "image_input": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 14,
          "description": "Up to 14 reference images for editing, multi-image fusion, or character consistency."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "2:3",
            "3:2",
            "3:4",
            "4:3",
            "4:5",
            "5:4",
            "9:16",
            "16:9",
            "21:9",
            "1:4",
            "4:1",
            "1:8",
            "8:1"
          ]
        },
        "match_input_image": {
          "type": "boolean",
          "description": "If true, output matches the first input image's aspect ratio (overrides aspect_ratio)."
        },
        "output_format": {
          "type": "string",
          "enum": [
            "jpg",
            "png"
          ]
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/google/nano-banana-pro-4k/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/google/nano-banana-pro-4k/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/google/nano-banana-pro-4k/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/google/nano-banana-pro-4k/predictions" -X POST --json '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/google/nano-banana-pro-4k/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/google/nano-banana-pro-4k/predictions" -m POST -b '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/google/nano-banana-pro-4k/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/google/nano-banana-pro-4k/predictions" -m POST -b '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}' -p x402
```

### Replicate: google/nano-banana-pro

Google Nano Banana Pro (Gemini 3 Pro Image) at 2K. Premium text-to-image and editing with strong text rendering and multi-subject consistency.

- Method: POST
- Path: `/models/google/nano-banana-pro/predictions`
- Price: $0.28000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "image_input": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 14,
          "description": "Up to 14 reference images for editing, multi-image fusion, or character consistency."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "2:3",
            "3:2",
            "3:4",
            "4:3",
            "4:5",
            "5:4",
            "9:16",
            "16:9",
            "21:9",
            "1:4",
            "4:1",
            "1:8",
            "8:1"
          ]
        },
        "match_input_image": {
          "type": "boolean",
          "description": "If true, output matches the first input image's aspect ratio (overrides aspect_ratio)."
        },
        "output_format": {
          "type": "string",
          "enum": [
            "jpg",
            "png"
          ]
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/google/nano-banana-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/google/nano-banana-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/google/nano-banana-pro/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/google/nano-banana-pro/predictions" -X POST --json '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/google/nano-banana-pro/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/google/nano-banana-pro/predictions" -m POST -b '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/google/nano-banana-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image_input": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/google/nano-banana-pro/predictions" -m POST -b '{"input":{"prompt":"","image_input":["https://example.com"],"aspect_ratio":"1:1"}}' -p x402
```

### Replicate: ideogram-ai/ideogram-v3-balanced

Ideogram V3 balanced tier. Better detail than turbo.

- Method: POST
- Path: `/models/ideogram-ai/ideogram-v3-balanced/predictions`
- Price: $0.12000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "16:9",
            "9:16",
            "4:3",
            "3:4",
            "3:2",
            "2:3",
            "16:10",
            "10:16",
            "1:3",
            "3:1"
          ]
        },
        "resolution": {
          "type": "string",
          "pattern": "^\\d+x\\d+$",
          "description": "e.g. '1024x1024'."
        },
        "magic_prompt": {
          "type": "string",
          "enum": [
            "Auto",
            "On",
            "Off"
          ]
        },
        "style_type": {
          "type": "string",
          "enum": [
            "None",
            "Auto",
            "General",
            "Realistic",
            "Design"
          ]
        },
        "negative_prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "image": {
          "type": "string",
          "format": "uri",
          "description": "Reference image for inpaint/remix flows."
        },
        "mask": {
          "type": "string",
          "format": "uri"
        },
        "style_reference_images": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 3
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-balanced/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "resolution": ""
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-balanced/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "resolution": ""
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-balanced/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","resolution":""}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-balanced/predictions" -X POST --json '{"input":{"prompt":"","aspect_ratio":"1:1","resolution":""}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-balanced/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","resolution":""}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-balanced/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","resolution":""}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-balanced/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "resolution": ""
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-balanced/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","resolution":""}}' -p x402
```

### Replicate: ideogram-ai/ideogram-v3-quality

Ideogram V3 quality tier. Premium output for book covers and prints.

- Method: POST
- Path: `/models/ideogram-ai/ideogram-v3-quality/predictions`
- Price: $0.18000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "16:9",
            "9:16",
            "4:3",
            "3:4",
            "3:2",
            "2:3",
            "16:10",
            "10:16",
            "1:3",
            "3:1"
          ]
        },
        "resolution": {
          "type": "string",
          "pattern": "^\\d+x\\d+$",
          "description": "e.g. '1024x1024'."
        },
        "magic_prompt": {
          "type": "string",
          "enum": [
            "Auto",
            "On",
            "Off"
          ]
        },
        "style_type": {
          "type": "string",
          "enum": [
            "None",
            "Auto",
            "General",
            "Realistic",
            "Design"
          ]
        },
        "negative_prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "image": {
          "type": "string",
          "format": "uri",
          "description": "Reference image for inpaint/remix flows."
        },
        "mask": {
          "type": "string",
          "format": "uri"
        },
        "style_reference_images": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 3
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-quality/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "resolution": ""
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-quality/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "resolution": ""
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-quality/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","resolution":""}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-quality/predictions" -X POST --json '{"input":{"prompt":"","aspect_ratio":"1:1","resolution":""}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-quality/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","resolution":""}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-quality/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","resolution":""}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-quality/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "resolution": ""
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-quality/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","resolution":""}}' -p x402
```

### Replicate: ideogram-ai/ideogram-v3-turbo

Ideogram V3 turbo tier. Fast text rendering for logos and signage.

- Method: POST
- Path: `/models/ideogram-ai/ideogram-v3-turbo/predictions`
- Price: $0.06000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "16:9",
            "9:16",
            "4:3",
            "3:4",
            "3:2",
            "2:3",
            "16:10",
            "10:16",
            "1:3",
            "3:1"
          ]
        },
        "resolution": {
          "type": "string",
          "pattern": "^\\d+x\\d+$",
          "description": "e.g. '1024x1024'."
        },
        "magic_prompt": {
          "type": "string",
          "enum": [
            "Auto",
            "On",
            "Off"
          ]
        },
        "style_type": {
          "type": "string",
          "enum": [
            "None",
            "Auto",
            "General",
            "Realistic",
            "Design"
          ]
        },
        "negative_prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "image": {
          "type": "string",
          "format": "uri",
          "description": "Reference image for inpaint/remix flows."
        },
        "mask": {
          "type": "string",
          "format": "uri"
        },
        "style_reference_images": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 3
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-turbo/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "resolution": ""
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-turbo/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "resolution": ""
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-turbo/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","resolution":""}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-turbo/predictions" -X POST --json '{"input":{"prompt":"","aspect_ratio":"1:1","resolution":""}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-turbo/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","resolution":""}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-turbo/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","resolution":""}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-turbo/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "resolution": ""
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/ideogram-ai/ideogram-v3-turbo/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","resolution":""}}' -p x402
```

### Replicate: nightmareai/real-esrgan

Classic ESRGAN super-resolution. Fast, deterministic, no creative additions.

- Method: POST
- Path: `/models/nightmareai/real-esrgan/predictions`
- Price: $0.01000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "image": {
          "type": "string",
          "format": "uri",
          "description": "Image to upscale."
        },
        "scale": {
          "type": "number",
          "minimum": 1,
          "maximum": 10,
          "description": "Default 4."
        },
        "face_enhance": {
          "type": "boolean"
        }
      },
      "required": [
        "image"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/nightmareai/real-esrgan/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "image": "https://example.com",
      "scale": 1,
      "face_enhance": false
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/nightmareai/real-esrgan/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "image": "https://example.com",
      "scale": 1,
      "face_enhance": false
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/nightmareai/real-esrgan/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"image":"https://example.com","scale":1,"face_enhance":false}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/nightmareai/real-esrgan/predictions" -X POST --json '{"input":{"image":"https://example.com","scale":1,"face_enhance":false}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/nightmareai/real-esrgan/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"image":"https://example.com","scale":1,"face_enhance":false}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/nightmareai/real-esrgan/predictions" -m POST -b '{"input":{"image":"https://example.com","scale":1,"face_enhance":false}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/nightmareai/real-esrgan/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "image": "https://example.com",
      "scale": 1,
      "face_enhance": false
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/nightmareai/real-esrgan/predictions" -m POST -b '{"input":{"image":"https://example.com","scale":1,"face_enhance":false}}' -p x402
```

### Replicate: openai/gpt-image-1.5-high

GPT Image 1.5 (high quality, equivalent to `auto`). Highest fidelity tier with transparent-background support.

- Method: POST
- Path: `/models/openai/gpt-image-1.5-high/predictions`
- Price: $0.28000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "input_images": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 10,
          "description": "Reference images for editing or composition."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "3:2",
            "2:3"
          ]
        },
        "input_fidelity": {
          "type": "string",
          "enum": [
            "low",
            "high"
          ],
          "description": "How strongly to preserve faces and stylistic features from input_images. Default low."
        },
        "number_of_images": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10,
          "description": "Number of images to generate per call. Default 1."
        },
        "background": {
          "type": "string",
          "enum": [
            "auto",
            "transparent",
            "opaque"
          ]
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "png",
            "jpeg"
          ]
        },
        "output_compression": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "description": "Compression level for jpeg/webp. Default 90."
        },
        "moderation": {
          "type": "string",
          "enum": [
            "auto",
            "low"
          ]
        },
        "user_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "description": "Optional end-user identifier for OpenAI abuse monitoring."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/openai/gpt-image-1.5-high/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/openai/gpt-image-1.5-high/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/openai/gpt-image-1.5-high/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/openai/gpt-image-1.5-high/predictions" -X POST --json '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/openai/gpt-image-1.5-high/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/openai/gpt-image-1.5-high/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/openai/gpt-image-1.5-high/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/openai/gpt-image-1.5-high/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}' -p x402
```

### Replicate: openai/gpt-image-1.5-medium

GPT Image 1.5 (medium quality). Production sweet spot — supports transparent backgrounds.

- Method: POST
- Path: `/models/openai/gpt-image-1.5-medium/predictions`
- Price: $0.11000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "input_images": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 10,
          "description": "Reference images for editing or composition."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "3:2",
            "2:3"
          ]
        },
        "input_fidelity": {
          "type": "string",
          "enum": [
            "low",
            "high"
          ],
          "description": "How strongly to preserve faces and stylistic features from input_images. Default low."
        },
        "number_of_images": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10,
          "description": "Number of images to generate per call. Default 1."
        },
        "background": {
          "type": "string",
          "enum": [
            "auto",
            "transparent",
            "opaque"
          ]
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "png",
            "jpeg"
          ]
        },
        "output_compression": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "description": "Compression level for jpeg/webp. Default 90."
        },
        "moderation": {
          "type": "string",
          "enum": [
            "auto",
            "low"
          ]
        },
        "user_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "description": "Optional end-user identifier for OpenAI abuse monitoring."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/openai/gpt-image-1.5-medium/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/openai/gpt-image-1.5-medium/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/openai/gpt-image-1.5-medium/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/openai/gpt-image-1.5-medium/predictions" -X POST --json '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/openai/gpt-image-1.5-medium/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/openai/gpt-image-1.5-medium/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/openai/gpt-image-1.5-medium/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/openai/gpt-image-1.5-medium/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}' -p x402
```

### Replicate: openai/gpt-image-1.5

OpenAI GPT Image 1.5 (low quality). Cheapest tier with transparent-background support. Strong instruction following and text rendering.

- Method: POST
- Path: `/models/openai/gpt-image-1.5/predictions`
- Price: $0.03000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "input_images": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 10,
          "description": "Reference images for editing or composition."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "3:2",
            "2:3"
          ]
        },
        "input_fidelity": {
          "type": "string",
          "enum": [
            "low",
            "high"
          ],
          "description": "How strongly to preserve faces and stylistic features from input_images. Default low."
        },
        "number_of_images": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10,
          "description": "Number of images to generate per call. Default 1."
        },
        "background": {
          "type": "string",
          "enum": [
            "auto",
            "transparent",
            "opaque"
          ]
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "png",
            "jpeg"
          ]
        },
        "output_compression": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "description": "Compression level for jpeg/webp. Default 90."
        },
        "moderation": {
          "type": "string",
          "enum": [
            "auto",
            "low"
          ]
        },
        "user_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "description": "Optional end-user identifier for OpenAI abuse monitoring."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/openai/gpt-image-1.5/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/openai/gpt-image-1.5/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/openai/gpt-image-1.5/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/openai/gpt-image-1.5/predictions" -X POST --json '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/openai/gpt-image-1.5/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/openai/gpt-image-1.5/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/openai/gpt-image-1.5/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/openai/gpt-image-1.5/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}' -p x402
```

### Replicate: openai/gpt-image-2-high

GPT Image 2 (high quality, equivalent to `auto`). Highest fidelity — covers, hero imagery, dense text scenes.

- Method: POST
- Path: `/models/openai/gpt-image-2-high/predictions`
- Price: $0.26000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "input_images": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 10,
          "description": "Reference images for editing or composition."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "3:2",
            "2:3"
          ]
        },
        "number_of_images": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10,
          "description": "Number of images to generate per call. Default 1."
        },
        "background": {
          "type": "string",
          "enum": [
            "auto",
            "transparent",
            "opaque"
          ]
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "png",
            "jpeg"
          ]
        },
        "output_compression": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "description": "Compression level for jpeg/webp. Default 90."
        },
        "moderation": {
          "type": "string",
          "enum": [
            "auto",
            "low"
          ]
        },
        "user_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "description": "Optional end-user identifier for OpenAI abuse monitoring."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/openai/gpt-image-2-high/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/openai/gpt-image-2-high/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/openai/gpt-image-2-high/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/openai/gpt-image-2-high/predictions" -X POST --json '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/openai/gpt-image-2-high/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/openai/gpt-image-2-high/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/openai/gpt-image-2-high/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/openai/gpt-image-2-high/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}' -p x402
```

### Replicate: openai/gpt-image-2-medium

GPT Image 2 (medium quality). Sweet spot for production marketing assets.

- Method: POST
- Path: `/models/openai/gpt-image-2-medium/predictions`
- Price: $0.10000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "input_images": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 10,
          "description": "Reference images for editing or composition."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "3:2",
            "2:3"
          ]
        },
        "number_of_images": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10,
          "description": "Number of images to generate per call. Default 1."
        },
        "background": {
          "type": "string",
          "enum": [
            "auto",
            "transparent",
            "opaque"
          ]
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "png",
            "jpeg"
          ]
        },
        "output_compression": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "description": "Compression level for jpeg/webp. Default 90."
        },
        "moderation": {
          "type": "string",
          "enum": [
            "auto",
            "low"
          ]
        },
        "user_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "description": "Optional end-user identifier for OpenAI abuse monitoring."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/openai/gpt-image-2-medium/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/openai/gpt-image-2-medium/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/openai/gpt-image-2-medium/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/openai/gpt-image-2-medium/predictions" -X POST --json '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/openai/gpt-image-2-medium/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/openai/gpt-image-2-medium/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/openai/gpt-image-2-medium/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/openai/gpt-image-2-medium/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}' -p x402
```

### Replicate: openai/gpt-image-2

OpenAI GPT Image 2 (low quality). Cheapest tier — drafts, thumbnails, rapid iteration. Strong instruction following and sharp text rendering.

- Method: POST
- Path: `/models/openai/gpt-image-2/predictions`
- Price: $0.03000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "input_images": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "maxItems": 10,
          "description": "Reference images for editing or composition."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "3:2",
            "2:3"
          ]
        },
        "number_of_images": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10,
          "description": "Number of images to generate per call. Default 1."
        },
        "background": {
          "type": "string",
          "enum": [
            "auto",
            "transparent",
            "opaque"
          ]
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "png",
            "jpeg"
          ]
        },
        "output_compression": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "description": "Compression level for jpeg/webp. Default 90."
        },
        "moderation": {
          "type": "string",
          "enum": [
            "auto",
            "low"
          ]
        },
        "user_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "description": "Optional end-user identifier for OpenAI abuse monitoring."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/openai/gpt-image-2/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/openai/gpt-image-2/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/openai/gpt-image-2/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/openai/gpt-image-2/predictions" -X POST --json '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/openai/gpt-image-2/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/openai/gpt-image-2/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/openai/gpt-image-2/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "input_images": [
        "https://example.com"
      ],
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/openai/gpt-image-2/predictions" -m POST -b '{"input":{"prompt":"","input_images":["https://example.com"],"aspect_ratio":"1:1"}}' -p x402
```

### Replicate: recraft-ai/recraft-v3

Best-in-class for typography, posters, brand assets, and vector output.

- Method: POST
- Path: `/models/recraft-ai/recraft-v3/predictions`
- Price: $0.08000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "size": {
          "type": "string",
          "enum": [
            "1024x1024",
            "1365x1024",
            "1024x1365",
            "1536x1024",
            "1024x1536",
            "1820x1024",
            "1024x1820",
            "1024x2048",
            "2048x1024",
            "1434x1024",
            "1024x1434",
            "1024x1280",
            "1280x1024",
            "1024x1707",
            "1707x1024"
          ]
        },
        "style": {
          "type": "string",
          "minLength": 1,
          "description": "Recraft style. Examples: 'any', 'realistic_image', 'digital_illustration', or nested forms like 'digital_illustration/pixel_art'. Replicate validates the full enum upstream — invalid values trigger an auto-refunded 422."
        },
        "substyle": {
          "type": "string",
          "minLength": 1,
          "description": "Recraft substyle within the chosen style."
        },
        "colors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "rgb": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 255
                },
                "minItems": 3,
                "maxItems": 3
              }
            },
            "required": [
              "rgb"
            ],
            "additionalProperties": false
          },
          "description": "Up to 3 RGB colors to bias the palette."
        },
        "background_color": {
          "type": "object",
          "properties": {
            "rgb": {
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 0,
                "maximum": 255
              },
              "minItems": 3,
              "maxItems": 3
            }
          },
          "required": [
            "rgb"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/recraft-ai/recraft-v3/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "size": "1024x1024",
      "style": ""
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/recraft-ai/recraft-v3/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "size": "1024x1024",
      "style": ""
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/recraft-ai/recraft-v3/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","size":"1024x1024","style":""}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/recraft-ai/recraft-v3/predictions" -X POST --json '{"input":{"prompt":"","size":"1024x1024","style":""}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/recraft-ai/recraft-v3/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","size":"1024x1024","style":""}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/recraft-ai/recraft-v3/predictions" -m POST -b '{"input":{"prompt":"","size":"1024x1024","style":""}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/recraft-ai/recraft-v3/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "size": "1024x1024",
      "style": ""
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/recraft-ai/recraft-v3/predictions" -m POST -b '{"input":{"prompt":"","size":"1024x1024","style":""}}' -p x402
```

### Replicate: recraft-ai/recraft-v4

Recraft V4. Latest Recraft model — strong prompt accuracy, art-directed composition, integrated text rendering.

- Method: POST
- Path: `/models/recraft-ai/recraft-v4/predictions`
- Price: $0.08000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "Not set",
            "1:1",
            "4:3",
            "3:4",
            "3:2",
            "2:3",
            "16:9",
            "9:16",
            "1:2",
            "2:1",
            "14:10",
            "10:14",
            "4:5",
            "5:4",
            "6:10"
          ]
        },
        "size": {
          "type": "string",
          "enum": [
            "1024x1024",
            "1536x768",
            "768x1536",
            "1280x832",
            "832x1280",
            "1216x896",
            "896x1216",
            "1152x896",
            "896x1152",
            "832x1344",
            "1280x896",
            "896x1280",
            "1344x768",
            "768x1344"
          ],
          "description": "Explicit WxH. Ignored when aspect_ratio is set (other than \"Not set\")."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/recraft-ai/recraft-v4/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "Not set",
      "size": "1024x1024"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/recraft-ai/recraft-v4/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "Not set",
      "size": "1024x1024"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/recraft-ai/recraft-v4/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"Not set","size":"1024x1024"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/recraft-ai/recraft-v4/predictions" -X POST --json '{"input":{"prompt":"","aspect_ratio":"Not set","size":"1024x1024"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/recraft-ai/recraft-v4/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"Not set","size":"1024x1024"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/recraft-ai/recraft-v4/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"Not set","size":"1024x1024"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/recraft-ai/recraft-v4/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "Not set",
      "size": "1024x1024"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/recraft-ai/recraft-v4/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"Not set","size":"1024x1024"}}' -p x402
```

### Replicate: recraft-ai/recraft-v4-pro

Recraft V4 Pro. ~2048px output with V4 design taste. Print-ready and large-scale work.

- Method: POST
- Path: `/models/recraft-ai/recraft-v4-pro/predictions`
- Price: $0.50000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "Not set",
            "1:1",
            "4:3",
            "3:4",
            "3:2",
            "2:3",
            "16:9",
            "9:16",
            "1:2",
            "2:1",
            "4:5",
            "5:4",
            "6:10",
            "14:10",
            "10:14"
          ]
        },
        "size": {
          "type": "string",
          "enum": [
            "2048x2048",
            "3072x1536",
            "1536x3072",
            "2560x1664",
            "1664x2560",
            "2432x1792",
            "1792x2432",
            "2304x1792",
            "1792x2304",
            "1664x2688",
            "2560x1792",
            "1792x2560",
            "2688x1536",
            "1536x2688"
          ],
          "description": "Explicit WxH. Ignored when aspect_ratio is set (other than \"Not set\")."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/recraft-ai/recraft-v4-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "Not set",
      "size": "2048x2048"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/recraft-ai/recraft-v4-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "Not set",
      "size": "2048x2048"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/recraft-ai/recraft-v4-pro/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"Not set","size":"2048x2048"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/recraft-ai/recraft-v4-pro/predictions" -X POST --json '{"input":{"prompt":"","aspect_ratio":"Not set","size":"2048x2048"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/recraft-ai/recraft-v4-pro/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"Not set","size":"2048x2048"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/recraft-ai/recraft-v4-pro/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"Not set","size":"2048x2048"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/recraft-ai/recraft-v4-pro/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "Not set",
      "size": "2048x2048"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/recraft-ai/recraft-v4-pro/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"Not set","size":"2048x2048"}}' -p x402
```

### Replicate: recraft-ai/recraft-v4-svg

Recraft V4 SVG. Production-ready vector output — clean geometry, structured layers, editable paths. Best for logos and icons.

- Method: POST
- Path: `/models/recraft-ai/recraft-v4-svg/predictions`
- Price: $0.16000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "Not set",
            "1:1",
            "4:3",
            "3:4",
            "3:2",
            "2:3",
            "16:9",
            "9:16",
            "1:2",
            "2:1",
            "14:10",
            "10:14",
            "4:5",
            "5:4",
            "6:10"
          ]
        },
        "size": {
          "type": "string",
          "enum": [
            "1024x1024",
            "1536x768",
            "768x1536",
            "1280x832",
            "832x1280",
            "1216x896",
            "896x1216",
            "1152x896",
            "896x1152",
            "832x1344",
            "1280x896",
            "896x1280",
            "1344x768",
            "768x1344"
          ],
          "description": "Explicit WxH. Ignored when aspect_ratio is set (other than \"Not set\")."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/recraft-ai/recraft-v4-svg/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "Not set",
      "size": "1024x1024"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/recraft-ai/recraft-v4-svg/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "Not set",
      "size": "1024x1024"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/recraft-ai/recraft-v4-svg/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"Not set","size":"1024x1024"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/recraft-ai/recraft-v4-svg/predictions" -X POST --json '{"input":{"prompt":"","aspect_ratio":"Not set","size":"1024x1024"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/recraft-ai/recraft-v4-svg/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"Not set","size":"1024x1024"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/recraft-ai/recraft-v4-svg/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"Not set","size":"1024x1024"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/recraft-ai/recraft-v4-svg/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "Not set",
      "size": "1024x1024"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/recraft-ai/recraft-v4-svg/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"Not set","size":"1024x1024"}}' -p x402
```

### Replicate: stability-ai/stable-diffusion-3.5-large

Stability AI SD 3.5 Large. Strong stylized output and full negative-prompt support.

- Method: POST
- Path: `/models/stability-ai/stable-diffusion-3.5-large/predictions`
- Price: $0.13000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "16:9",
            "21:9",
            "3:2",
            "2:3",
            "4:5",
            "5:4",
            "3:4",
            "4:3",
            "9:16",
            "9:21"
          ]
        },
        "cfg": {
          "type": "number",
          "minimum": 0,
          "maximum": 20
        },
        "steps": {
          "type": "integer",
          "minimum": 1,
          "maximum": 60
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "jpg",
            "png"
          ]
        },
        "output_quality": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "negative_prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "image": {
          "type": "string",
          "format": "uri"
        },
        "prompt_strength": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/stability-ai/stable-diffusion-3.5-large/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "cfg": 0
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/stability-ai/stable-diffusion-3.5-large/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "cfg": 0
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/stability-ai/stable-diffusion-3.5-large/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","cfg":0}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/stability-ai/stable-diffusion-3.5-large/predictions" -X POST --json '{"input":{"prompt":"","aspect_ratio":"1:1","cfg":0}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/stability-ai/stable-diffusion-3.5-large/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","cfg":0}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/stability-ai/stable-diffusion-3.5-large/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","cfg":0}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/stability-ai/stable-diffusion-3.5-large/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "cfg": 0
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/stability-ai/stable-diffusion-3.5-large/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","cfg":0}}' -p x402
```

### Replicate: stability-ai/stable-diffusion-3.5-large-turbo

SD 3.5 Large Turbo. 1-4 step variant, ~3× faster than SD 3.5 Large.

- Method: POST
- Path: `/models/stability-ai/stable-diffusion-3.5-large-turbo/predictions`
- Price: $0.08000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "16:9",
            "21:9",
            "3:2",
            "2:3",
            "4:5",
            "5:4",
            "3:4",
            "4:3",
            "9:16",
            "9:21"
          ]
        },
        "cfg": {
          "type": "number",
          "minimum": 0,
          "maximum": 5,
          "description": "Turbo uses lower CFG than base SD3.5. Default 1."
        },
        "steps": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10,
          "description": "Turbo runs in 1-4 steps. Default 4."
        },
        "output_format": {
          "type": "string",
          "enum": [
            "webp",
            "jpg",
            "png"
          ]
        },
        "output_quality": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "negative_prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "seed": {
          "type": "integer",
          "minimum": 0,
          "description": "Random seed; omit for non-deterministic outputs."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/stability-ai/stable-diffusion-3.5-large-turbo/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "cfg": 0
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/stability-ai/stable-diffusion-3.5-large-turbo/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "cfg": 0
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/stability-ai/stable-diffusion-3.5-large-turbo/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","cfg":0}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/stability-ai/stable-diffusion-3.5-large-turbo/predictions" -X POST --json '{"input":{"prompt":"","aspect_ratio":"1:1","cfg":0}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/stability-ai/stable-diffusion-3.5-large-turbo/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","aspect_ratio":"1:1","cfg":0}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/stability-ai/stable-diffusion-3.5-large-turbo/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","cfg":0}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/stability-ai/stable-diffusion-3.5-large-turbo/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "aspect_ratio": "1:1",
      "cfg": 0
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/stability-ai/stable-diffusion-3.5-large-turbo/predictions" -m POST -b '{"input":{"prompt":"","aspect_ratio":"1:1","cfg":0}}' -p x402
```

### Replicate: xai/grok-imagine-image

xAI Grok Imagine. SOTA image generation and single-image editing from xAI.

- Method: POST
- Path: `/models/xai/grok-imagine-image/predictions`
- Price: $0.04000000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "input": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "description": "Text prompt describing the desired image."
        },
        "image": {
          "type": "string",
          "format": "uri",
          "description": "Optional single image to edit. Omit for pure text-to-image."
        },
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "1:1",
            "16:9",
            "9:16",
            "4:3",
            "3:4",
            "3:2",
            "2:3",
            "2:1",
            "1:2",
            "19.5:9",
            "9:19.5",
            "20:9",
            "9:20",
            "auto"
          ]
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Replicate prediction ID."
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "succeeded",
        "failed",
        "canceled",
        "processing",
        "starting"
      ]
    },
    "output": {
      "description": "Model-specific output. Image/audio models return CDN URLs (Replicate-hosted, ~24h TTL); vision-LLM models return a string; music models return a single audio URL or array."
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "metrics": {
      "type": "object",
      "properties": {
        "predict_time": {
          "type": "number"
        },
        "total_time": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": "string"
    },
    "predicted_price_usd": {
      "type": "string",
      "description": "USD charged for this call."
    }
  },
  "required": [
    "id",
    "model",
    "status",
    "error",
    "predicted_price_usd"
  ],
  "additionalProperties": false,
  "description": "Replicate prediction result with metadata."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://replicate.payweave.services/models/xai/grok-imagine-image/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image": "https://example.com",
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://replicate.payweave.services/models/xai/grok-imagine-image/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image": "https://example.com",
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://replicate.payweave.services/models/xai/grok-imagine-image/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image":"https://example.com","aspect_ratio":"1:1"}}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://replicate.payweave.services/models/xai/grok-imagine-image/predictions" -X POST --json '{"input":{"prompt":"","image":"https://example.com","aspect_ratio":"1:1"}}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://replicate.payweave.services/models/xai/grok-imagine-image/predictions" -X POST -H 'Content-Type: application/json' -d '{"input":{"prompt":"","image":"https://example.com","aspect_ratio":"1:1"}}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://replicate.payweave.services/models/xai/grok-imagine-image/predictions" -m POST -b '{"input":{"prompt":"","image":"https://example.com","aspect_ratio":"1:1"}}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://replicate.payweave.services/models/xai/grok-imagine-image/predictions', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "input": {
      "prompt": "",
      "image": "https://example.com",
      "aspect_ratio": "1:1"
    }
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://replicate.payweave.services/models/xai/grok-imagine-image/predictions" -m POST -b '{"input":{"prompt":"","image":"https://example.com","aspect_ratio":"1:1"}}' -p x402
```
