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

# Deploy

> Deploy a service. Returns NDJSON stream with progress updates.

Post the source as `source_archive`, the tar.gz, up to 100 MiB. Ship
large files via volumes (`cycls volume put`), not the source archive.

`timeout` is how long a single request to the deployed service may run
raise it for long compute, up to Cloud Run's 3600s ceiling. `cpu` is raised
automatically if `memory` requires more than you asked for.

`concurrency` is how many requests one instance serves at once. Leave it high
for I/O-bound apps; set it to 1 for compute, so each call gets its own instance.

`max_instances` caps how many instances the service may scale to. 0 (default)
leaves scaling to the platform.

`volumes` maps mount paths to volumes (JSON), e.g. `{"/data": "shared"}` or
`{"/data": {"name": "shared", "read_only": true, "sub_path": "v1"}}`.
Required, `{}` declares no storage; the deploy is a complete declaration.
Unknown volumes are created (announced in the stream).

`schedule` fires the deployed function on a cron: `{"cron": "0 3 * * *",
"timezone": "Asia/Riyadh"}`. Empty or omitted removes any schedule, the
same complete-declaration rule.

Events: `BUILDING` → `DEPLOYING` → `DONE` (or `ERROR`)



## OpenAPI

````yaml /api-reference/openapi.json post /v1/deploy
openapi: 3.1.0
info:
  title: Cycls Cloud API
  description: >

    ## Deploy serverless functions in seconds


    Cycls Cloud lets you deploy containerized functions to the cloud with a
    single command.


    ### Authentication


    All endpoints require authentication via:

    - **API Key**: Pass `X-API-Key` header

    - **JWT**: Pass `Authorization: Bearer <token>` header


    ### Quick Start


    ```bash

    curl -X POST https://api.cycls.ai/v1/deploy \
      -H "X-API-Key: your_api_key" \
      -F "function_name=hello" \
      -F "source=@source.tar.gz"
    ```
  contact:
    name: Cycls
    url: https://cycls.com/
  version: 1.0.0
servers: []
security: []
tags:
  - name: Deployments
    description: Deploy, list, and manage your services
  - name: Volumes
    description: Named storage, attached to deployments by mount path
  - name: Logs
    description: Fetch service logs
  - name: Billing
    description: Subscription and usage
paths:
  /v1/deploy:
    post:
      tags:
        - Deployments
      summary: Deploy
      description: >-
        Deploy a service. Returns NDJSON stream with progress updates.


        Post the source as `source_archive`, the tar.gz, up to 100 MiB. Ship

        large files via volumes (`cycls volume put`), not the source archive.


        `timeout` is how long a single request to the deployed service may run

        raise it for long compute, up to Cloud Run's 3600s ceiling. `cpu` is
        raised

        automatically if `memory` requires more than you asked for.


        `concurrency` is how many requests one instance serves at once. Leave it
        high

        for I/O-bound apps; set it to 1 for compute, so each call gets its own
        instance.


        `max_instances` caps how many instances the service may scale to. 0
        (default)

        leaves scaling to the platform.


        `volumes` maps mount paths to volumes (JSON), e.g. `{"/data": "shared"}`
        or

        `{"/data": {"name": "shared", "read_only": true, "sub_path": "v1"}}`.

        Required, `{}` declares no storage; the deploy is a complete
        declaration.

        Unknown volumes are created (announced in the stream).


        `schedule` fires the deployed function on a cron: `{"cron": "0 3 * * *",

        "timezone": "Asia/Riyadh"}`. Empty or omitted removes any schedule, the

        same complete-declaration rule.


        Events: `BUILDING` → `DEPLOYING` → `DONE` (or `ERROR`)
      operationId: deploy_v1_deploy_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_deploy_v1_deploy_post'
        required: true
      responses:
        '200':
          description: NDJSON stream of deployment progress
          content:
            application/json:
              schema: {}
            application/x-ndjson: {}
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          description: Service Unavailable
      security:
        - HTTPBearer: []
        - APIKeyHeader: []
components:
  schemas:
    Body_deploy_v1_deploy_post:
      properties:
        function_name:
          type: string
          title: Function Name
        port:
          type: integer
          title: Port
          default: 8080
        memory:
          type: string
          title: Memory
          default: 1Gi
        source_archive:
          anyOf:
            - type: string
              format: binary
            - type: 'null'
          title: Source Archive
        source_object:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Object
        session_affinity:
          type: boolean
          title: Session Affinity
          default: false
        use_http2:
          type: boolean
          title: Use Http2
          default: false
        timeout:
          type: integer
          maximum: 3600
          minimum: 1
          title: Timeout
          default: 600
        cpu:
          type: integer
          title: Cpu
          default: 1
        concurrency:
          type: integer
          maximum: 1000
          minimum: 1
          title: Concurrency
          default: 80
        max_instances:
          type: integer
          maximum: 1000
          minimum: 0
          title: Max Instances
          default: 0
        volumes:
          anyOf:
            - type: string
            - type: 'null'
          title: Volumes
        schedule:
          type: string
          title: Schedule
          default: ''
        timezone:
          type: string
          title: Timezone
          default: ''
      type: object
      required:
        - function_name
      title: Body_deploy_v1_deploy_post
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````