Prerequisites
Before making API calls, please ensure you have obtained the following credentials:Base URL
API Endpoint, formatted as:
https://api.onetoken.oneAPI Key
The token generated in the OneToken dashboard, formatted as:
sk-xxxxxxxxxxxx1. Text to Image API
This endpoint is used to generate a brand-new image from scratch based on the text prompt you provide.Request Information
Request Format
application/jsonRequest Parameters
Code Examples
2. Image Edits API
This endpoint is used to modify an existing image. You need to provide an original image and a mask image (transparent areas in the mask image indicate parts that need to be modified/replaced).Request Information
Request Format
multipart/form-dataRequest Parameters
The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of png, jpeg, or webp.
Code Examples
3. Response Data Structure
Upon a successful API call, a JSON object containing the image data will be returned.Success Response Example
4. Common Sizes
Custom image dimensions must meet all of the following requirements:
All recommended sizes below meet these requirements:

