Skip to main content
POST
중국 본토 사용자 안내: 중국 본토 사용자는 https://toapis.cn 를 API 엔드포인트(Base URL)로 사용해 주세요. 본 문서의 예시에서 https://toapis.com 을 https://toapis.cn 로 바꿔 주세요.
The docs Playground does not support file uploads: Please use the cURL, Python, or JavaScript code examples below for testing.
Important Change: For better performance and cost control, we no longer support passing base64 image data directly in generation APIs. Please use this endpoint to upload images first, then use the returned URL in generation requests.

Why Upload First?

  1. Performance - Base64 encoding inflates data by 33%, uploading first significantly reduces request payload size
  2. Reusability - Upload once, use the URL multiple times without re-transmitting

Workflow

Authorizations

string
필수
Use Bearer Token for authenticationGet your API Key: Visit API Key Management

Body

file
필수
Image fileSupported formats:
  • JPEG (.jpg, .jpeg)
  • PNG (.png)
  • WebP (.webp)
  • GIF (.gif)
Limits:
  • Maximum file size: 10MB
string
Upload purpose (optional)Default: generation

응답

boolean
Whether the request succeeded
object

Complete Example: Image-to-Image Workflow

Here’s a complete image-to-image workflow example:
Python Complete Example