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

# Base64 to URL

> Convert base64 strings of image, audio, video and 3d object file to a valid URL.

<Note>
  The URL expires in 24 hours, supports max 5MB uploads, and requires valid base64 format.
</Note>

## Request

Send a `POST` request to below endpoint.

```curl curl theme={null}
--request POST 'https://modelslab.com/api/v6/base64_to_url' \
```

## Body

```json json theme={null}
{  
  "key": "your_api_key",  
  "base64_string": "data:image/png;base64,<your_base_64_string>"
}
```


## OpenAPI

````yaml POST /base64_to_url
openapi: 3.1.0
info:
  title: ModelsLab General API
  description: >-
    General utility endpoints for ModelsLab API including subscription
    management, content moderation, and file handling
  license:
    name: MIT
  version: 6.0.0
servers:
  - url: https://modelslab.com/api
    description: Main API server (for endpoints without version prefix)
  - url: https://modelslab.com/api/v3
    description: API v3 server
  - url: https://modelslab.com/api/v5
    description: API v5 server
  - url: https://modelslab.com/api/v6
    description: API v6 server
security: []
paths:
  /base64_to_url:
    post:
      summary: Upload base64 to URL
      description: >-
        This endpoint allows you to convert base64 strings of image, audio,
        video and 3d object file to a valid URL. The url expires after 24 hours
        of creation. Note that the maximum file size for upload is 5MB
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Base64ToUrlRequest'
      responses:
        '200':
          description: Base64 to URL response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Base64ToUrlResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      servers:
        - url: https://modelslab.com/api/v6
components:
  schemas:
    Base64ToUrlRequest:
      type: object
      required:
        - key
        - base64_string
      properties:
        key:
          type: string
          description: Your API Key used for request authorization
        base64_string:
          type: string
          description: Image to be uploaded converted in base64 format
    Base64ToUrlResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
        id:
          type: integer
          description: Unique identifier for the upload
        output:
          type: array
          items:
            type: string
            format: uri
          description: Array of URLs to the uploaded files
    Error:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
          description: Error message

````