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. Sign in to your Artguru account, then visit the Artguru Developer Platform.
  2. Generate or retrieve the active API credential for that account.
  3. Keep the key on your server and avoid sharing it.

An API key is a credential for the signed-in account. Subscription status, credit balance, and credit usage belong to that account; call-rate and active-task limits are currently enforced for the API key used by the request. See Rate limits and task quotas for the exact limits and retry behavior.

Keep API keys server-side

Do not embed an API key in browser JavaScript, mobile applications, public source code, screenshots, or client-visible logs. If you believe a key has been exposed, stop using it and contact support to have it revoked or replaced. Do not switch or rotate keys to work around a 429 or 503 response.

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 authentication method and endpoint contracts are stable. Any breaking change will be announced in advance with a deprecation window.

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"
}'

Credits and pricing​

A valid key authenticates your account. Task submission also requires an active subscription and sufficient credits. See Pricing for the latest API rates, which can differ from website rates even when they share a credit balance.

Authentication errors​

If the x-api-key header is missing, invalid, or inactive, the API returns HTTP 401 Unauthorized:

{
"code": -1,
"message": "Invalid or inactive api-key",
"requestId": "7f3a1c92-4b8e-4d21-9a6f-2c5e8b1d0437"
}

Verify the key and confirm it is sent on every request. For all other status and business error codes, see Errors.

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