Skip to main content

Authentication

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

API Endpoint

https://api.artguru.ai

Authentication

Artguru OpenAPI uses the x-api-key header for authentication. You must include your API key in the x-api-key header of every request.

x-api-key: <your_api_key>

Here, <your_api_key> is the API key you obtained from https://www.artguru.ai/create-api-key/.

How to Obtain an API Key

  1. Visit the Artguru Developer Platform (register for an account if you haven't already).
  2. Keep your API key secure and avoid sharing it.

To simplify the API trial process during the beta phase, please note the following:

  • The API is currently available only to Artguru subscribers. Credit balance and usage records are shared with your Artguru subscription account.
  • The billing model may differ from the final public release. Please stay tuned for official updates.
  • Rest assured, the API integration method will remain the same, and no additional development changes will be required in the future.

Example Request (Using cURL)

Below is an example of sending a request using cURL, demonstrating how to include the x-api-key and Content-Type headers:

curl --location 'https://api.artguru.ai/api/v1/enhance/generate' \
--header 'x-api-key: <your_api_key>' \
--header 'Content-Type: application/json' \
--data '{
"image": "https://img.artguru.ai/upscale/d6e711de-ddad-4019-892f-837a8a421fc5.jpg"
}'

Error Handling

If your request is missing or contains an invalid API key, 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 message fields to provide more detailed error information:

  • 0: Success
  • Non-zero: error — check message for details (e.g. 24403: not subscribed or out of the subscription period)

Summary

To successfully access Artguru OpenAPI, you need to:

  1. Use the correct API endpoint.
  2. Include a valid API key in the x-api-key header.

By following these steps, you can securely and effectively utilize the features of Artguru Open API. If you encounter any issues during access or authentication, please contact our technical support team promptly.

Contact email: support@artguru.ai