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

# Run a SQL query

> Run a read-only SQL query across the database's tables.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/query_sql/{database}
openapi: 3.1.0
info:
  title: Infino API
  description: >-
    The Infino hosted data-plane API: per-database table operations — create,
    ingest, search, and SQL.
  version: 0.1.0
servers:
  - url: https://api.platform.infino.ws
    description: Infino Cloud
security:
  - api_key: []
tags:
  - name: Databases
    description: Create, list, and delete the databases in your account.
  - name: Tables
    description: Create, drop, and list tables, and describe a table's schema.
  - name: Rows
    description: Append, update, and delete rows.
  - name: Search
    description: BM25, vector, and hybrid search, token and exact match, count, and SQL.
paths:
  /v1/query_sql/{database}:
    post:
      tags:
        - Search
      summary: Run a SQL query
      description: Run a read-only SQL query across the database's tables.
      operationId: sql_query
      parameters:
        - name: database
          in: path
          description: Target database.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SqlQueryRequest'
        required: true
      responses:
        '200':
          description: >-
            Matching rows as an Arrow IPC stream
            (application/vnd.apache.arrow.stream), or JSON when the request
            sends `Accept: application/json`.
        '400':
          description: Invalid request body.
        '401':
          description: Missing or invalid API key.
        '503':
          description: >-
            The database's workers are still activating, or no capacity is free
            to place them. Transient — retry after the `Retry-After` interval.
      security:
        - api_key: []
components:
  schemas:
    SqlQueryRequest:
      type: object
      description: '`POST /v1/sql_query/{database}`.'
      required:
        - query
      properties:
        query:
          type: string
      additionalProperties: false
  securitySchemes:
    api_key:
      type: http
      scheme: bearer

````