AITOPIA Edit API
The Edit API from AITOPIA — 1 operation(s) for edit.
The Edit API from AITOPIA — 1 operation(s) for edit.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/aitopia-ai:aitopia-ai-edit-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: AITOPIA REST Edit API
version: 1.0.0
description: 'Run AITOPIA models, edits and batches over HTTP. Submit calls return a request_id; poll GET /v1/requests/{request_id} (optionally with ?wait=N) or receive a signed webhook. Results are kept 30 days. Credit figures are estimates. The sandbox server takes test keys (aitk_test_...): same requests and validation, simulated results, no credits spent.'
servers:
- url: https://api-live.aitopia.ai
description: 'Live: real runs, credits are charged. Live keys (aitk_live_...).'
- url: https://api-sandbox.aitopia.ai
description: 'Sandbox: simulated runs, nothing is charged. Test keys (aitk_test_...).'
security:
- Key: []
tags:
- name: Edit
paths:
/v1/edit:
post:
operationId: editMedia
summary: Edit an asset from an instruction
parameters:
- name: wait
in: query
required: false
description: Long-poll up to N seconds (integer 0-60) for a terminal status.
schema:
type: integer
minimum: 0
maximum: 60
- name: dry_run
in: query
required: false
description: true/1/yes returns a price estimate and runs nothing; false/0/no (or absent) runs. Anything else is a 400.
schema:
type: string
enum:
- 'true'
- '1'
- 'yes'
- 'false'
- '0'
- 'no'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- asset_url
- instruction
properties:
asset_url:
type: string
format: uri
instruction:
type: string
media_type:
type: string
max_credits:
type: number
plan_token:
type: string
description: 'From a dry run: run exactly that priced plan.'
webhook_url:
type: string
format: uri
description: Optional https URL (public host only) that receives the final result as a signed POST.
responses:
'200':
description: Dry run estimate (dry_run=true)
content:
application/json:
schema:
$ref: '#/components/schemas/DryRun'
'202':
description: Accepted
content:
application/json:
schema:
$ref: '#/components/schemas/Request'
'400':
description: INVALID_INPUT (with field), URL_NOT_ALLOWED, MODEL_REQUIRED, MODEL_KIND_MISMATCH, MODEL_NOT_ALLOWED, DUPLICATE_ITEM or INVALID_RUN_TOKEN
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: UNAUTHENTICATED (missing/invalid/revoked key) or KEY_SESSION_EXPIRED (sign in to aitopia.ai to reactivate the key)
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'402':
description: INSUFFICIENT_CREDITS, KEY_CREDIT_CAP_REACHED or OVER_BUDGET
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'409':
description: PRICE_CHANGED, PRICE_UNKNOWN or PLAN_EXPIRED
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: PLAN_INVALID, ASSET_UNREACHABLE or NOT_SUPPORTED
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'429':
description: RATE_LIMIT, RUN_LIMITED or QUEUE_LIMIT_EXCEEDED (see retry_after_seconds and the Retry-After header)
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: INTERNAL_ERROR (an unexpected server error)
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'502':
description: 'UPSTREAM_5XX, or UPSTREAM_UNCERTAIN (the run may have started: check the request_id in the body and your balance before retrying)'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'503':
description: MODEL_UNAVAILABLE, SERVER_RESTARTING or SESSION_UNAVAILABLE (retryable)
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'504':
description: TIMEOUT
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
tags:
- Edit
components:
schemas:
Error:
type: object
required:
- error
properties:
error:
type: object
required:
- code
- message
- retryable
properties:
code:
type: string
message:
type: string
retryable:
type: boolean
field:
type: string
retry_after_seconds:
type: number
request_id:
type: string
description: 'Present when the request was recorded before it failed: check GET /v1/requests/{request_id} before retrying.'
Media:
type: object
required:
- url
- content_type
properties:
url:
type: string
format: uri
content_type:
type: string
width:
type: number
height:
type: number
duration:
type: number
Output:
type: object
required:
- images
- videos
- audio
- files
properties:
images:
type: array
items:
$ref: '#/components/schemas/Media'
videos:
type: array
items:
$ref: '#/components/schemas/Media'
audio:
type: array
items:
$ref: '#/components/schemas/Media'
files:
type: array
items:
type: object
properties:
url:
type: string
content_type:
type:
- string
- 'null'
DryRun:
type: object
properties:
dry_run:
const: true
endpoint:
type: string
credits_estimated:
type:
- number
- 'null'
affordable:
type:
- boolean
- 'null'
credits_available:
type:
- number
- string
- 'null'
complete:
type: boolean
basis:
type: string
plan_token:
type: string
description: 'edit only: send it to POST /v1/edit to run exactly this priced plan.'
plan_token_expires_in_sec:
type: number
items:
type: array
items:
type: object
Item:
type: object
required:
- status
- output
properties:
index:
type: integer
status:
$ref: '#/components/schemas/RequestStatus'
output:
$ref: '#/components/schemas/Output'
error:
$ref: '#/components/schemas/Error/properties/error'
credits_estimated:
type:
- number
- 'null'
RequestStatus:
type: string
enum:
- queued
- running
- completed
- partial
- failed
- cancelled
Request:
type: object
required:
- request_id
- status
- endpoint
- created_at
- completed_at
- credits_estimated
- output
- status_url
- result_url
- cancel_url
properties:
request_id:
type: string
status:
$ref: '#/components/schemas/RequestStatus'
endpoint:
type: string
created_at:
type: string
format: date-time
completed_at:
type:
- string
- 'null'
format: date-time
credits_estimated:
type:
- number
- 'null'
output:
$ref: '#/components/schemas/Output'
items:
type: array
items:
$ref: '#/components/schemas/Item'
error:
$ref: '#/components/schemas/Error/properties/error'
aitopia_url:
type: string
format: uri
status_url:
type: string
format: uri
result_url:
type: string
format: uri
cancel_url:
type: string
format: uri
securitySchemes:
Key:
type: http
scheme: bearer
bearerFormat: aitk_live_... or aitk_test_...
description: 'Send "Authorization: Key <key>" (Bearer <key> is also accepted). Live keys work on the live server, test keys on the sandbox server. Create keys on your aitopia.ai profile.'