Brix API: Developer Portal
Welcome to the official Brix API portal! Here you'll find the detailed documentation to integrate your partner bot or external application with our services. Our HTTP API lets you perform currency conversion, query user data and expand integrations with the Brix ecosystem, kyu~!
Authentication & How to Get a Token
Authentication across the entire Brix API is standardized through the Authorization HTTP header with the unique validation token provided exclusively for your bot or application.
| Header |
Value |
Authorization |
brix_SEU_TOKEN_AQUI |
To request your token: Currently, only previously invited bots and developers can request a token. If you have been invited, contact us directly through the
official support server, providing more details about your project and how you want to integrate with the system.
Currency Conversion API ( /api/pix )
This API allows bidirectional currency conversion between your partner bot and the Brix ecosystem. Your users can convert their currency into Braixencoin, and Brix can also trigger requests to your bot to convert Braixencoin back into your currency.
Endpoint (/api/pix)
Brix receives conversion requests via HTTP POST at the central endpoint:
POST
https://brixbot.xyz/api/pix
Testing Mechanism (Sandbox)
Brix has a built-in testing system to make implementing currency conversion easier:
- How to test: Send the request without the authorization header or with an invalid token.
- What happens: The server will accept the request (
200 OK) but mark it as a test (modo_teste: true).
- Behavior in the Bot: The user provided in the field (
user_id) will receive a DM confirming the test, but no balance will be added and no transaction log will be generated; the (ref_id) will be automatically deleted after processing.
Important: Even when returning 200 OK, no real transaction is performed in test mode.
Request Body (JSON)
The system uses universal English terms, maintaining compatibility with various systems by presenting a single field identification standard.
| Field |
Type |
Required |
Description |
user_id |
String / Int |
Yes |
Discord user ID that will receive the conversion. |
amount |
Integer |
Yes |
Amount of currency to convert. |
ref_id |
String (24) |
Yes |
Unique reference ID for the transaction. Used to prevent duplicate processing if the request is resent. Suggested pattern: 24 characters. |
currency |
String |
No |
Source currency name. If omitted, the registered default is used. |
currency_icon |
URL |
No |
Image URL (PNG/JPG) used as the currency icon in the DM. |
cURL Example (Production)
curl -X POST https://brixbot.xyz/api/pix \
-H "Authorization: brix_seu_token_real" \
-H "Content-Type: application/json" \
-d '{
"user_id": "123456789012345678",
"amount": 654,
"currency": "MinhaMoeda",
"currency_icon": "https://meusite.com/moeda.png",
"ref_id": "xN7pL9qY2mR5kH4vC8wB3jF1"
}'
Conversion Fees and Limits
Brix's conversion system was built to be simple, transparent and fair:
- No Brix fees: Brix charges no fee to convert braixencoin into external currencies, nor the other way around. The amount sent and received is exactly the same.
- Sending limit (regular users): Users without Brix Premium can send up to 1,000,000 braixencoin per transaction, with a limit of 1 send per day.
- Sending with Brix Premium: Users with Brix Premium have no daily sending limit and can make multiple transfers freely (respecting only the 1,000,000 braixencoin limit).
- Receiving limit: It is possible to receive up to 10,000,000 braixencoin per transaction, with no daily receiving limit.
- Partner bot fees: External bots may apply their own fees on conversions. These fees are not controlled by Brix and must be clearly disclosed to the user before the transaction.
- Receiving bot restrictions: The partner bot may define its own rules (limits, validations or blocks). If the transaction is not accepted, the webhook must respond with an error (status other than
200 OK). In that case, Brix will cancel the operation and automatically return the braixencoin to the user.
API Responses & Errors
Success (200 OK)
{
"~kyuuu": true,
"modo_teste": false
}
• modo_teste: true indicates the request was processed as a test (invalid/missing token).
Common Errors
| Code |
Description |
400 Bad Request | Invalid or malformed JSON. |
400 Bad Request | Missing required fields (user_id, amount, ref_id). |
400 Bad Request | user_id must be numeric and greater than 0. |
400 Bad Request | amount must be an integer, greater than 0 and less than 10,000,000. |
400 Bad Request | Invalid or too long currency (max. 50 characters). |
400 Bad Request | currency_icon must be a valid URL (http/https) and up to 300 characters. |
400 Bad Request | ref_id must be a valid string (24 alphanumeric characters, _ or -). |
400 Bad Request | Too many metadata fields (max. 20 fields). |
400 Bad Request | Metadata too large (key up to 50 chars, value up to 500 chars). |
429 Too Many Requests | Too many requests from the same IP (global rate limit). |
429 Too Many Requests | Too many requests for the same user (rate limit per user_id). |
200 OK | Duplicate transaction detected (same ref_id), successfully ignored. |
500 Internal Error | Unexpected error in the server's internal processing. |
Return Webhook (Brix → Partner)
Brix can also trigger requests to your bot when a user uses the /bc transferir command. In this flow, Braixencoins are converted back into your system's currency.
To receive transfers from Brix, you must provide a webhook URL during partnership registration. Brix will send a POST to that address using the same validation token in the Authorization header.
POST
https://seubot.xyz/seu-webhook
Payload Sent by Brix to your Webhook
| Field |
Type |
Description |
user_id | String | Discord user ID that made the transfer. |
amount | Integer | Amount of Braixencoins sent. |
bot_name | String | Always "Brix" — identifies the origin of the transfer. |
ref_id | String (24) | Unique transaction ID generated by Brix. Use it to prevent duplicate processing. |
currency_icon | URL | URL of the BraixenCoin image to be displayed in your bot's DMs. |
JSON Receipt Example
{
"user_id": "123456789012345678",
"amount": 654,
"bot_name": "Brix",
"ref_id": "sT6vM2bN8pK1xH4jL9cQ5wR3",
"currency_icon": "https://brixbot.xyz/cdn/icon_braixencoin.png"
}
Important: Brix will only register the transaction in its internal system if your webhook responds with 200 OK. Otherwise, the Braixencoin balance is automatically returned to the user.
Pro Tip: In production (valid token), the conversion enters the Pending state and the bot delivers the balance automatically once it processes the log. Make sure your webhook responds quickly to avoid timeouts.
User Lookup API ( /api/user )
Provides lookup of public account information and balances of Brix users (such as Braixencoins, twigs, reputation score, level/XP and premium subscription status) for integration with external applications.
Endpoint (/api/user)
GET
POST
https://brixbot.xyz/api/user
Sandbox Mode in /api/user
Test Lookup via Bot ID: If the call to /api/user is made without the Authorization header or with an invalid token, the API will respond in test mode ("modo_teste": true) by querying the database for the real account data of Brix itself. This lets you test the JSON response and its fields without needing to pass a specific token or ID!
Request Parameters
| Parameter |
Type |
Location |
Description |
user_id |
Integer / String |
Query String (GET) or JSON Body (POST) |
Numeric Discord ID of the user to look up. Required in production. |
JSON Response (/api/user)
Example of the JSON response returned in real time directly by the /api/user route of the system:
{
"status": "Carregando dados da API..."
}
| Field |
Type |
Description |
id | Integer | Numeric Discord user ID. |
braixencoin | Integer | User's current Braixencoin balance. |
graveto | Integer | User's current twig balance. |
xpg | Integer | Experience score / level. |
rep | Integer | Accumulated reputation score. |
descricao | String | "About me" text set in the user's profile. |
premium.ativo | Boolean | Indicates whether the user has an active Premium subscription. |
premium.expiracao | String / null | Subscription expiration date (DD/MM/YYYY) if applicable. |