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

# Export Proxies

> Hand back ready-to-use proxy lines.

Rotating packages expose one gateway per line; asking for more lines than
the package has unique gateways repeats them round-robin, which is exactly
how threads are sold. ``rotate`` (default true) mints a fresh session so the
returned lines get new exit IPs - lines exported earlier keep working.

Response carries ``Cache-Control: no-store``: these are live credentials.



## OpenAPI

````yaml /api-reference/proxy.json post /v1/proxy/subscriptions/{sub_id}/export
openapi: 3.1.0
info:
  title: Lumi Proxy API
  version: 1.1.0
  description: >-
    Публичный REST API прокси Lumi. Ключ привязан к одному аккаунту и делает то
    же, что клиент делает в боте.


    Авторизация: `Authorization: Bearer <ключ>`. Денежные запросы дополнительно
    требуют заголовок `Idempotency-Key`.
servers:
  - url: https://api.lumiweb.cc/proxy
    description: production
security:
  - bearerAuth: []
paths:
  /v1/proxy/subscriptions/{sub_id}/export:
    post:
      tags:
        - proxy
      summary: Export Proxies
      description: >-
        Hand back ready-to-use proxy lines.


        Rotating packages expose one gateway per line; asking for more lines
        than

        the package has unique gateways repeats them round-robin, which is
        exactly

        how threads are sold. ``rotate`` (default true) mints a fresh session so
        the

        returned lines get new exit IPs - lines exported earlier keep working.


        Response carries ``Cache-Control: no-store``: these are live
        credentials.
      operationId: export_proxies
      parameters:
        - name: sub_id
          in: path
          required: true
          schema:
            type: integer
            title: Sub Id
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ExportRequest:
      properties:
        count:
          anyOf:
            - type: integer
              maximum: 5000
              minimum: 1
            - type: 'null'
          title: Count
          description: >-
            how many proxy lines to return (threads); repeated round-robin when
            the package exposes fewer unique gateways. Omit for the natural
            size: one line for a rotating package, every issued IP for a static
            one.
        targets:
          anyOf:
            - items:
                $ref: '#/components/schemas/ExportTarget'
              type: array
              maxItems: 20
            - type: 'null'
          title: Targets
          description: >-
            pull several geos / rotation settings in ONE call. Rotating packages
            only. The subscription's own settings are never changed.
        format:
          anyOf:
            - type: string
              enum:
                - url
                - user:pass@host:port
                - user:pass:host:port
                - host:port:user:pass
            - type: 'null'
          title: Format
          description: defaults to the subscription's stored format
        protocol:
          anyOf:
            - type: string
              enum:
                - http
                - socks5
            - type: 'null'
          title: Protocol
          description: defaults to the subscription's protocol
        rotate:
          type: boolean
          title: Rotate
          description: >-
            mint a fresh session so the exported lines get new exit IPs;
            previously exported credentials keep working
          default: true
      type: object
      title: ExportRequest
    ExportOut:
      properties:
        subscription_id:
          type: integer
          title: Subscription Id
        count:
          type: integer
          title: Count
        format:
          type: string
          title: Format
        protocol:
          type: string
          title: Protocol
        access_mode:
          type: string
          title: Access Mode
        proxies:
          items:
            type: string
          type: array
          title: Proxies
        groups:
          anyOf:
            - items:
                $ref: '#/components/schemas/ExportGroup'
              type: array
            - type: 'null'
          title: Groups
          description: present when 'targets' was used; slices of 'proxies'
      type: object
      required:
        - subscription_id
        - count
        - format
        - protocol
        - access_mode
        - proxies
      title: ExportOut
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ExportTarget:
      properties:
        country:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Country
          description: ISO-2 code or name
        region:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Region
        city:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: City
        isp:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Isp
        rotation_seconds:
          anyOf:
            - type: integer
              maximum: 604800
              minimum: 1
            - type: 'null'
          title: Rotation Seconds
          description: omit for a new IP on every request
        session_mode:
          anyOf:
            - type: string
              enum:
                - rotating
                - sticky
            - type: 'null'
          title: Session Mode
        count:
          anyOf:
            - type: integer
              maximum: 5000
              minimum: 1
            - type: 'null'
          title: Count
          description: defaults to the request-level count
      type: object
      title: ExportTarget
      description: >-
        One geo / rotation slice of an export.


        Rotating packages carry their geo in the proxy username, so a single

        subscription can serve any country the pool has - line by line, without

        touching the package. A target overrides only the fields it sets; the
        rest

        come from the subscription.
    ExportGroup:
      properties:
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
        region:
          anyOf:
            - type: string
            - type: 'null'
          title: Region
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        isp:
          anyOf:
            - type: string
            - type: 'null'
          title: Isp
        rotation_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Rotation Seconds
        session_mode:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Mode
        offset:
          type: integer
          title: Offset
        count:
          type: integer
          title: Count
      type: object
      required:
        - offset
        - count
      title: ExportGroup
      description: Where one target's lines sit inside ``proxies`` (no duplication).
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Ключ вида lumi_proxy_… Выдаётся оператором.

````