> ## 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.

# SQL over your logs and billing

> Run SQL against your own logs and billing data. Two views are pre-set in your
default dataset:

  - `logs`   , Cloud Logging entries for your deployments
  - `billing`, Cloud Billing rows for your deployments

Each tenant gets their own BigQuery dataset and service account; cross-tenant
references fail at the IAM layer.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/sql
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/sql:
    post:
      tags:
        - Logs
      summary: SQL over your logs and billing
      description: >-
        Run SQL against your own logs and billing data. Two views are pre-set in
        your

        default dataset:

          - `logs`   , Cloud Logging entries for your deployments
          - `billing`, Cloud Billing rows for your deployments

        Each tenant gets their own BigQuery dataset and service account;
        cross-tenant

        references fail at the IAM layer.
      operationId: sql_v1_sql_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SqlRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '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:
    SqlRequest:
      properties:
        query:
          type: string
          title: Query
          description: >-
            BigQuery SQL. Your default dataset contains views `logs` and
            `billing` scoped to deployments you own.
          examples:
            - >-
              SELECT timestamp, json_payload FROM logs WHERE
              json_payload.level='error' LIMIT 10
      type: object
      required:
        - query
      title: SqlRequest
    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

````