Skip to main content

Documentation Index

Fetch the complete documentation index at: https://doc.hitopen.com/llms.txt

Use this file to discover all available pages before exploring further.

Use these endpoints to check available top-up packages, initiate a payment to add quota to your account, redeem a top-up code, and review your top-up transaction history.
All payment endpoints require User permission. Authenticate with a system access token from Personal Settings → Security Settings → System Access Tokens. Payment availability depends on how your Newapi instance is configured — not all instances enable payments.

Endpoints

MethodPathDescription
GET/api/user/topup/infoGet available top-up packages and pricing
POST/api/user/payInitiate a payment
POST/api/user/topupRedeem a top-up code
GET/api/user/topup/selfGet your top-up transaction history

Get top-up packages

GET /api/user/topup/info
Returns the available top-up packages and pricing configured for the instance. Use this to display pricing options to your users before initiating a payment.

Example

curl -X GET "https://YOUR_NEWAPI_BASE_URL/api/user/topup/info" \
  -H "Authorization: Bearer your-access-token"

Response fields

success
boolean
Whether the request succeeded.
data
object
Top-up configuration for this instance.

Initiate a payment

POST /api/user/pay
Initiates a payment session to purchase quota. The response typically includes a payment URL or session token to redirect your user to the payment provider (such as Stripe or Epay).
The payment flow depends on the payment provider configured by your instance administrator. After the payment is completed on the provider’s side, Newapi automatically credits the purchased quota to your account.

Example

curl -X POST "https://YOUR_NEWAPI_BASE_URL/api/user/pay" \
  -H "Authorization: Bearer your-access-token" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 10
  }'

Response fields

success
boolean
Whether the payment session was created successfully.
data
string
The payment URL or session identifier. Redirect your user to this URL to complete the payment.

Redeem a top-up code

POST /api/user/topup
Redeems a top-up code to add quota to your account. Top-up codes can be issued by administrators or distributed as part of promotional campaigns.

Request body

key
string
required
The top-up redemption code to redeem.

Example

curl -X POST "https://YOUR_NEWAPI_BASE_URL/api/user/topup" \
  -H "Authorization: Bearer your-access-token" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "TOPUP-XXXX-XXXX-XXXX"
  }'

Response fields

success
boolean
Whether the code was redeemed successfully.
message
string
A message describing the result, including the quota amount credited if successful.

Get your top-up history

GET /api/user/topup/self
Returns your top-up transaction history, including payments and code redemptions.

Example

curl -X GET "https://YOUR_NEWAPI_BASE_URL/api/user/topup/self" \
  -H "Authorization: Bearer your-access-token"

Response fields

success
boolean
Whether the request succeeded.
data
object[]
List of top-up transactions.