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

# Transpile SQL

> Transpiles a SQL query from Peaka's SQL dialect (Trino) into the specified target dialect (e.g., mysql, postgres, bigquery). Useful when you need to export or reuse queries written in Peaka in other database systems.

<span style={{display: "flex", gap: "10px", flexDirection: "row", alignItems: "center"}}>
  <img src="https://cdn.peaka.com/badges/partner-api-key-badge.png" />

  <img src="https://cdn.peaka.com/badges/project-api-key-badge.png" />
</span>


## OpenAPI

````yaml post /sql/transpile/{dialect}
openapi: 3.0.1
info:
  title: Peaka Gateway API
  description: Peaka Gateway API Documentation
  version: '1.0'
servers:
  - url: https://partner.peaka.studio/api/v1
    description: Default Server URL (US Zone)
  - url: https://partner.eu.peaka.studio/api/v1
    description: EU Zone
security:
  - bearerAuth: []
paths:
  /sql/transpile/{dialect}:
    post:
      tags:
        - Data -- SQL
      summary: Transpile SQL
      description: >-
        Transpiles a SQL query from Peaka's SQL dialect (Trino) into the
        specified target dialect (e.g., mysql, postgres, bigquery). Useful when
        you need to export or reuse queries written in Peaka in other database
        systems.
      operationId: transpileSQL
      parameters:
        - name: dialect
          in: path
          description: Target SQL dialect to transpile into
          required: true
          schema:
            type: string
          example: mysql
      requestBody:
        description: SQL query to transpile
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SQLTranspileQueryRequest'
            examples:
              Transpile Query Example:
                description: Transpile Query Example
                value:
                  query: SELECT * FROM catalog.schema.table WHERE id = 1
        required: true
      responses:
        '200':
          description: Transpiled query
          content:
            application/json:
              examples:
                Transpiled Result:
                  description: Transpiled Result
                  value:
                    result: SELECT * FROM `catalog`.`schema`.`table` WHERE `id` = 1
components:
  schemas:
    SQLTranspileQueryRequest:
      type: object
      properties:
        query:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        Use the Authorization header with the value 'Bearer <apiKey>' to
        authenticate. Partner API Keys have full access; Project API Keys are
        limited to their project scope. Learn more:
        https://docs.peaka.com/api-reference/authentication
      scheme: bearer
      bearerFormat: Api Key

````