Fotor OpenAPI
  1. Getting Started
Fotor OpenAPI
  • Getting Started
    • Introduction
    • Access and Authentication
    • For Serverless Clients
    • Token Consumption
  • Reference
    • AI Upscaler
      POST
    • AI Skin Retouch
      POST
    • Text to Image
      POST
    • Image to Image (AI Art Effects)
      POST
    • Background Remover
      POST
    • AI Headshot
      POST
    • Photo Colorize
      POST
    • Photo Restoration
      POST
    • Face Swap
      POST
    • AI Replace
      POST
    • Query Task Details
      GET
  • Webhook
    • Webhook
  • AI Editor SDK
    • Getting Started
    • Get Sdk Temporary Token
      GET
  1. Getting Started

Access and Authentication

This section provides a detailed guide on how to access Fotor OpenAPI and authenticate your requests to ensure secure usage of our API services.

API Endpoint#

https://api-b.fotor.com  

Authentication#

Fotor OpenAPI uses Bearer Token authentication. You must include your API key in the Authorization header of every request.
Authorization: Bearer <your_api_key>
Here, <your_api_key> is the API key you obtained from the Fotor Developer Platform.

How to Obtain an API Key#

1.
Visit the Fotor Developer Platform (register for an account if you haven’t already).
2.
Sign up as a developer.
3.
Navigate to the API Key Management page to create your API key.
4.
Keep your API key secure and avoid sharing it.

Request Headers#

In addition to the Authorization header, you must specify the Content-Type header as application/json, indicating that the request body is in JSON format.
Content-Type: application/json

Example Request (Using cURL)#

Below is an example of sending a request using cURL, demonstrating how to include the Authorization and Content-Type headers:
Replace <your_api_key> with your actual API key.

Error Handling#

If your request is missing or contains an invalid Authorization token, the API will return a 401 Unauthorized error. You should verify your API key and ensure it is correctly included in the request header.
Other common HTTP status codes include:
400 Bad Request: The request parameters are incomplete or incorrectly formatted.
429 Too Many Requests: Excessive request rate.
500 Internal Server Error: A server-side error occurred.
The API also returns a JSON response body with code and msg fields to provide more detailed error information:
000: Success
999: Unknown error

Summary#

To successfully access Fotor OpenAPI, you need to:
1.
Use the correct API endpoint.
2.
Include a valid API key in the Authorization header.
3.
Set the Content-Type header to application/json.
By following these steps, you can securely and effectively utilize the features of Fotor OpenAPI.
If you encounter any issues during access or authentication, please contact our technical support team promptly.
Modified at 2025-01-22 03:35:23
Previous
Introduction
Next
For Serverless Clients
Built with