aiapigiare System API Tutorial

Request Sandbox
1curl -X GET "https://api.aiapigiare.io.vn/user" \
2 -H "Authorization: Bearer YOUR_ACCESS_KEY"
Target: api.aiapigiare.io.vn
TLS 1.3 Active
Response Sample
1{
2 "data": {
3 "access_token": "XXXXX",
4 "display_name": "Your Display Name",
5 "email": "your.email@example.com",
6 "quota": 8664402091,
7 "request_count": 213527,
8 "role": 1,
9 "telegram_id": "",
10 "used_quota": 1460014143,
11 "username": "your_username"
12 },
13 "message": "",
14 "success": true
15}
Target: api.aiapigiare.io.vn
TLS 1.3 Active

This tutorial will guide you through the process of integrating with the aiapigiare System API. You will learn how to retrieve user information, manage your API keys, track your tasks, and access system logs.

Base URL: https://api.aiapigiare.io.vn

Table of Contents

  1. Prerequisites
  2. Authentication
  3. API Endpoints

1. Prerequisites

Before you begin, ensure you have the following:

  • Access Key: Obtain your unique Access Key from your aiapigiare account's home page. This key is essential for authenticating your API requests.

2. Authentication

All requests to the aiapigiare System API require authentication. You must include your Access Key in the Authorization header for most endpoints.

Header Format:

(Code extracted to sandbox)

Replace ACCESS_KEY with your actual Access Key.


3. API Endpoints

The following sections detail the available API endpoints and how to use them.

3.1 Get User Information

Retrieve detailed information about your aiapigiare user account.

  • Endpoint: /AiApiGiaRe/user
  • Method: GET
  • Headers:
    • Authorization: Bearer ACCESS_KEY (Replace ACCESS_KEY)

Example Request:

(Code extracted to sandbox)

Example Response:

(Code extracted to sandbox)

Response Field Descriptions:

  • quota: Your remaining credits. To convert to USD, divide by 500,000.
  • used_quota: Your consumed credits. To convert to USD, divide by 500,000.
  • Other fields provide user profile and account details.

3.2 API Key Management

Endpoints for listing, deleting, and managing the quota of your API keys.

3.2.1 List API Keys

Fetch a list of all API keys associated with your aiapigiare account.

  • Endpoint: /AiApiGiaRe/apikeylist
  • Method: GET
  • Query Parameters:
    • keyword (optional): A string to filter API keys by name.
    • token (optional): Your user token.
  • Headers:
    • Authorization: Bearer ACCESS_KEY (Replace ACCESS_KEY)

Example Request:

(Code extracted to sandbox)

Example Response:

(Code extracted to sandbox)

Response Field Descriptions:

  • id: The unique identifier for the API key.
  • key: The API key string (partially masked).
  • name: A user-defined name for the key.
  • status: The status of the key (e.g., 1 for active).
  • remain_quota: The remaining quota assigned to this key.
  • unlimited_quota: A boolean indicating if the key has unlimited quota.
  • used_quota: The total quota consumed by this key.
  • expired_time: The Unix timestamp for when the key expires (-1 for no expiration).

3.2.2 Delete API Key

Deletes a specific API key.

  • Endpoint: /AiApiGiaRe/deletekey/{key_id}
  • Method: DELETE
  • URL Parameters:
    • key_id (required): The unique ID of the API key to delete.
  • Headers:
    • Authorization: Bearer ACCESS_KEY (Replace ACCESS_KEY)

Example Request:

(Code extracted to sandbox)

Example Success Response:

(Code extracted to sandbox)

3.2.3 Adjust Quota

Sets or changes the credit quota for a specific API key.

  • Endpoint: /AiApiGiaRe/editquota/{key_id}
  • Method: PUT
  • URL Parameters:
    • key_id (required): The unique ID of the API key to modify.
  • Headers:
    • Authorization: Bearer ACCESS_KEY (Replace ACCESS_KEY)
    • Content-Type: application/json

Request Body:

The payload should be a JSON object containing the new quota.

(Code extracted to sandbox)

Note on Quota: The remain_quota value is converted to USD credits by dividing it by 500,000. For example, a remain_quota of 50,000,000 is equivalent to $100.

Example Request:

(Code extracted to sandbox)

3.3 List Tasks

Retrieve a list of tasks executed by your account, with options to filter by time.

  • Endpoint: /AiApiGiaRe/task
  • Method: GET
  • Query Parameters:
    • start_timestamp (required): The Unix timestamp marking the beginning of the time range.
    • end_timestamp (required): The Unix timestamp marking the end of the time range.
  • Headers:
    • Authorization: Bearer ACCESS_KEY (Replace ACCESS_KEY)

Example Request:

(Code extracted to sandbox)

3.4 Get Logs

Access system logs related to your API usage. You can filter logs by various parameters, including time ranges.

  • Endpoint: /AiApiGiaRe/logs
  • Method: GET
  • Query Parameters:
    • p (optional): Page number for pagination. Defaults to 1.
    • page_size (optional): Number of items per page. Defaults to 10000.
    • type (optional): Type of logs to retrieve (e.g., 2).
    • token_name (optional): Filter logs by a specific token name.
    • model_name (optional): Filter logs by a specific model name.
    • username (optional): Filter logs by username.
    • start_timestamp (optional): The Unix timestamp marking the beginning of the time range for logs.
    • end_timestamp (optional): The Unix timestamp marking the end of the time range for logs.
  • Headers:
    • Authorization: Bearer ACCESS_KEY (Replace ACCESS_KEY)

Example Request:

(Code extracted to sandbox)

3.5 List Models

Retrieve a list of all available models in the system.

  • Endpoint: /AiApiGiaRe/models
  • Method: GET
  • Headers:
    • Authorization: Bearer ACCESS_KEY (Replace ACCESS_KEY with your actual key)

Example Request:

(Code extracted to sandbox)

Example Response:

(Code extracted to sandbox)

Response Body Fields

Here is an explanation of the key fields in the response object.

  • model_name: The unique identifier for the model (e.g., imagen4-fast).
  • uptime: Indicates the operational status of the model's API.
    • 1: The API is operating normally.
    • 0: The API is currently under maintenance.
  • is_deprecation: Shows the deprecation status of the model.
    • 0: The model is active and fully supported.
    • 1: The model is deprecated and will be removed in a future update. Users should plan to migrate to an alternative.
    • 2: The model is no longer active and cannot be used.
  • endpoint: The specific API path to use for making requests to this model (e.g., /v1/images/generations).
  • billing_type: The method used for billing (e.g., pay-per-request).
  • price_per_request: The estimated cost for a single API call to this model.
  • provider_name: The original provider of the AI model (e.g., "Google", "OpenAI").
  • category: The categories the model belongs to, such as "Image" or "Text Generation".
  • docs: A link to the official documentation for the model.
  • saving_details: A breakdown of the cost savings when using aiapigiare compared to the official provider's price.

Infrastructure: AiApiGiaRe-v10.0
Gateway Status: Operational