> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.erlcrussia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Exchange coins for credits

> Exchanges your coins for AI credits at a 1:1 rate.



## OpenAPI

````yaml en/openapi/en-api-v3-openapi.yaml POST /ai/credits/exchange
openapi: 3.1.0
info:
  title: ER:LC Russia API V3
  description: >-
    ER:LC Russia API for servers, users, CDN, redirects, subscriptions, and
    access keys.
  version: 3.0.0
servers:
  - url: https://api.erlcrussia.com/v3
    description: Production server (com)
  - url: https://api.erlcrussia.xyz/v3
    description: Backup server (xyz)
security: []
tags:
  - name: ER:LC Server
    description: Obtaining status, online, lists of players and staff of the ER:LC server.
  - name: ER:LC Teams
    description: Sending and queuing in-game server commands (:h, :m, :kick, :ban, etc.).
  - name: Economics
    description: >-
      Interaction with the economic system (users, businesses, mafias, stores,
      advertising).
  - name: Statistics API
    description: >-
      High-performance obtaining statistics of discord servers and game servers
      (online, participants, bots).
  - name: Verification API
    description: Search and comparison of Discord ID and Roblox ID accounts.
  - name: CDN Assets
    description: >-
      Load, manage, statistic and clear MinIO/Edge CDN object storage file
      cache.
  - name: CDN Folders
    description: Hierarchical structure and sorting of CDN media library folders.
  - name: Punishment API
    description: Manage the balance and transaction history of players' points.
  - name: Subscriptions API
    description: >-
      Catalog of plans, FunPay orders, accrual of benefits and activation of
      subscriptions.
  - name: Authorization API
    description: >-
      Login via Discord and Roblox OAuth2, manage user sessions and link
      accounts.
  - name: Management API - WebSocket Keys
    description: Managing access keys to the WebSocket gateway and channel subscriptions.
  - name: Management API - Webhooks
    description: Registration, accessibility validation and monitoring of custom webhooks.
  - name: Control API - Panel
    description: >-
      Management of users, subscriptions, tariffs, manual balance and system
      statistics.
  - name: State API
    description: >-
      Monitoring the performance of the service, connections to PostgreSQL and
      Redis.
  - name: AI Audio
  - name: AI Studio
  - name: AI administration
  - name: API Keys
  - name: Admin API - Servers
  - name: Administration of E-Coins
  - name: CDN
  - name: CDN Domains
  - name: CDN V3
  - name: Custom Webhooks
  - name: Management API - Servers
  - name: Management API - Tokens
  - name: Organization redirects V3
  - name: Private files and library
  - name: Рекламные кампании V3
paths:
  /ai/credits/exchange:
    post:
      tags:
        - AI Studio
      summary: Exchange coins for credits
      description: >-
        Exchanges your coins for AI credits at a 1:1 rate.


        Creating an AI key and exchanging coins require the owner session. An
        ordinary HTTP key, even with full access, cannot perform these
        operations. Trusted services use the admin endpoints with a master key.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                coins:
                  type: integer
                  minimum: 1
            example:
              coins: 100
      responses:
        '200':
          description: >-
            Coins exchanged (success, exchanged_coins, credits_added,
            new_credits, remaining_coins).
          content:
            application/json:
              example:
                success: true
                exchanged_coins: 100
                credits_added: 100
                new_credits: 252.4
                remaining_coins: 150
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  exchanged_coins:
                    type: integer
                  credits_added:
                    type: integer
                  new_credits:
                    type: number
                  remaining_coins:
                    type: integer
        '403':
          description: >-
            Owner session required; an ordinary HTTP key cannot authorize this
            operation.
      security:
        - CookieAuth: []
components:
  securitySchemes:
    CookieAuth:
      type: apiKey
      in: cookie
      name: erlc_auth
      description: Session HTTP-Only authorization cookie on the portal.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.