# For Serverless Clients



This API is designed for clients without a server or domain, providing an easy integration method. All API endpoints support access via standard URL parameters or Base64-encoded data, allowing clients to directly transmit resource data without the need for an intermediary server. Whether you are using browser-based JavaScript, mobile applications, or other clients unable to deploy a server, you can seamlessly integrate with our services.  

## Using Base64-Encoded Local Images  

Here is an example of using Base64-encoded local images in your API request:  

```bash
curl --location '/v1/aiart/img2img' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "content": "",
    "templateId": "7ca8f0af-d247-4747-93da-56014dbce660",
    "negativePrompt": "",
    "userImageUrl": "data:image/png;base64,iVBORw0KGgoAAAAN...",  // Using Base64-Encoded Image Data
    "width": null,
    "height": null,
    "format": "png"
  }'
```  

## Using Web Image URLs  

Here is an example of using web image URLs in your API request:  

```bash
curl --location '/v1/aiart/img2img' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "content": "",
    "templateId": "7ca8f0af-d247-4747-93da-56014dbce660",
    "negativePrompt": "",
    "userImageUrl": "https://u-static.fotor.com/uid_b195b7a44afc47ffb13dcfa82ad3935e/image_to_image/app-fotor-web/d6e711de-ddad-4019-892f-837a8a421fc5.jpg",  // Web Image URLs
    "width": null,
    "height": null,
    "format": "png"
  }'
```  

### Notes:  
- Replace `YOUR_API_KEY` with your actual API key obtained from the Fotor Developer Platform.  
- For Base64-encoded images, ensure that the data starts with the appropriate MIME type (e.g., `data:image/png;base64,`).  
- For web image URLs, the URL must be publicly accessible to ensure the API can retrieve the resource.  

By following these examples, you can easily integrate Fotor OpenAPI into your applications, regardless of whether you have a backend server.  
