AI Photo Studio Generation API
Authenticated endpoints that spend credits to create or edit media.
Authenticated endpoints that spend credits to create or edit media.
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/photoaistudio-com:photoaistudio-com-generation-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: Photo AI Studio Agent Generation API
version: 1.0.0
summary: Generate professional AI photos, edit images, and create video from a selfie — programmatically.
description: 'Machine-readable API surface for AI agents. Public discovery endpoints (capabilities, themes, products) require no authentication; generation and account endpoints use a Bearer token plus an X-Buyer-Email header identifying the end user. Also reachable over the Model Context Protocol at /api/mcp (manifest at /.well-known/mcp) and, for interactive checkout, the agentic-commerce endpoints under /api/commerce. Credits are the unit of spend (100 credits = 1 photo); prices and packages are in the product feed and at /pricing.
Versioning: this is v1. Send an optional `API-Version` request header (date- or number-based, e.g. `2026-08-25` or `1`) to pin behavior; without it, the current stable version is used. Breaking changes ship under a new version value and, where structural, a new `/vN/` path.
Deprecation & sunset policy: a version is supported for at least 6 months after its successor ships. When an endpoint or version is deprecated it returns a `Deprecation: true` header and a `Sunset: ` header (RFC 8594) giving the earliest removal date, plus a `Link` header with `rel="deprecation"` pointing to migration docs. Removal never happens before the advertised Sunset date.'
x-sunset-policy:
minSupportWindowMonths: 6
deprecationHeader: Deprecation
sunsetHeader: Sunset
docs: https://www.photoaistudio.com/for-developers
contact:
name: Photo AI Studio Support
email: contact@photoaistudio.com
url: https://www.photoaistudio.com/contact
termsOfService: https://www.photoaistudio.com/terms-conditions
license:
name: Proprietary
url: https://www.photoaistudio.com/terms-conditions
servers:
- url: https://www.photoaistudio.com
description: Production (v1)
security:
- bearerAuth: []
buyerEmail: []
tags:
- name: Generation
description: Authenticated endpoints that spend credits to create or edit media.
paths:
/api/agent/upload:
post:
tags:
- Generation
operationId: uploadImage
summary: Upload a source selfie/image
parameters:
- $ref: '#/components/parameters/ApiVersion'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- image
properties:
image:
type: string
description: Publicly reachable image URL or base64 data URI.
responses:
'200':
description: Uploaded image reference
content:
application/json:
schema:
$ref: '#/components/schemas/UploadResult'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/TooManyRequests'
default:
$ref: '#/components/responses/Error'
security:
- bearerAuth: []
- oauth2:
- photos:read
- photos:write
- bearerAuth: []
buyerEmail: []
/api/agent/generate:
post:
tags:
- Generation
operationId: generatePhotos
summary: Generate themed or custom AI photos from a selfie
description: Spends credits (100 credits per image). Returns a prediction to poll via /api/agent/predictions/{id}.
parameters:
- $ref: '#/components/parameters/ApiVersion'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- images
properties:
images:
type: array
items:
type: string
description: Uploaded image URL(s). Each must be a Photo AI Studio CDN URL returned by POST /api/agent/upload or by an earlier generation; external image hosts are deprecated and will be refused.
theme:
type: string
description: Theme category slug, e.g. professional-headshot.
prompt:
type: string
description: Custom prompt when not using a preset theme.
num_images:
type: integer
minimum: 1
maximum: 8
default: 4
responses:
'200':
description: Prediction created
content:
application/json:
schema:
$ref: '#/components/schemas/Prediction'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'402':
$ref: '#/components/responses/InsufficientCredits'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/TooManyRequests'
default:
$ref: '#/components/responses/Error'
security:
- bearerAuth: []
- oauth2:
- photos:read
- photos:write
- bearerAuth: []
buyerEmail: []
/api/agent/edit:
post:
tags:
- Generation
operationId: editImage
summary: AI-edit an image (background removal, retouch, upscale, face swap, and more)
parameters:
- $ref: '#/components/parameters/ApiVersion'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- image
- operation
properties:
image:
type: string
operation:
type: string
description: One of the 19 edit operations (e.g. remove-background, upscale, retouch, face-swap, clothes-try-on).
params:
type: object
additionalProperties: true
responses:
'200':
description: Prediction created
content:
application/json:
schema:
$ref: '#/components/schemas/Prediction'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'402':
$ref: '#/components/responses/InsufficientCredits'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/TooManyRequests'
default:
$ref: '#/components/responses/Error'
security:
- bearerAuth: []
- oauth2:
- photos:read
- photos:write
- bearerAuth: []
buyerEmail: []
/api/agent/video:
post:
tags:
- Generation
operationId: generateVideo
summary: Create video (image-to-video, UGC, product-holder)
parameters:
- $ref: '#/components/parameters/ApiVersion'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- type
properties:
type:
type: string
enum:
- image-to-video
- ugc
- product-holder
image:
type: string
prompt:
type: string
responses:
'200':
description: Prediction created
content:
application/json:
schema:
$ref: '#/components/schemas/Prediction'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'402':
$ref: '#/components/responses/InsufficientCredits'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/TooManyRequests'
default:
$ref: '#/components/responses/Error'
security:
- bearerAuth: []
- oauth2:
- photos:read
- photos:write
- bearerAuth: []
buyerEmail: []
components:
schemas:
UploadResult:
type: object
properties:
url:
type: string
format: uri
Prediction:
type: object
properties:
id:
type: string
state:
type: string
enum:
- starting
- processing
- succeeded
- failed
result_url:
type: string
format: uri
credits_spent:
type: integer
Error:
type: object
description: Structured JSON error. Agents should branch on `type` and surface `message`; `resolution` hints how to recover.
required:
- type
- message
properties:
type:
type: string
description: Stable machine-readable error code (e.g. invalid_request, unauthorized, insufficient_credits, not_found).
message:
type: string
description: Human-readable explanation.
resolution:
type: string
description: How to fix or recover from the error.
status:
type: integer
description: HTTP status code.
responses:
BadRequest:
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Forbidden:
description: The credential is valid but lacks the required scope, or the account is unavailable
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Unauthorized:
description: Missing or invalid Authorization header
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
InsufficientCredits:
description: Not enough credits to complete the operation
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Error:
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
TooManyRequests:
description: 'Rate limit exceeded. Paid operations (generate, edit, video) are never rate limited — credits are the only cap on how fast you can spend. Limits apply to work that costs you nothing: reads, uploads, public endpoints, requests that fail authentication, and generation requests that consume no credits. The body names the bucket in `scope` and gives `limit`, `window_seconds` and `retry_after`; the RateLimit-* / X-RateLimit-* headers carry the live policy, and a 429 also sends Retry-After.'
headers:
RateLimit-Limit:
schema:
type: integer
description: Requests allowed in the current window.
RateLimit-Remaining:
schema:
type: integer
description: Requests remaining in the current window.
RateLimit-Reset:
schema:
type: integer
description: Seconds until the window resets.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
parameters:
ApiVersion:
name: API-Version
in: header
required: false
description: Optional API version to pin (date-based e.g. 2026-08-25, or number e.g. 1). Omit to use the current stable version.
schema:
type: string
default: '1'
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: 'Bearer credential. Use a per-user API key (pa_sk_) created at https://www.photoaistudio.com/api-keys, an OAuth 2.1 access token (pa_at_) from /api/oauth/token, or a shared partner token together with X-Buyer-Email. Send as: Authorization: Bearer <token>.'
buyerEmail:
type: apiKey
in: header
name: X-Buyer-Email
description: Email of the end user the agent is acting for. Users are auto-created.
oauth2:
type: oauth2
description: OAuth 2.1 authorization code flow with PKCE. Used by remote MCP clients. Discover the endpoints at /.well-known/oauth-authorization-server and the protected resource at /.well-known/oauth-protected-resource.
flows:
authorizationCode:
authorizationUrl: https://www.photoaistudio.com/api/oauth/authorize
tokenUrl: https://www.photoaistudio.com/api/oauth/token
refreshUrl: https://www.photoaistudio.com/api/oauth/token
scopes:
photos:read: Read the account, credit balance, themes, and past generations.
photos:write: Upload images and spend credits on photos, edits, and videos.
externalDocs:
description: Developer guide, llms.txt, and MCP server
url: https://www.photoaistudio.com/for-developers