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

# Submit query

> Submit a Cairo program for STARK proof generation and optional on-chain verification via Atlantic API

<Warning>
  Please use this endpoint through our [Swagger UI](https://atlantic.api.herodotus.cloud/docs#/Atlantic%20Query/post_atlantic_query)!

  Sending it from these docs will not work because of a Mintlify (our documentation platform) [issue with uploading files](https://github.com/mintlify/docs/issues/345).
</Warning>


## OpenAPI

````yaml post /atlantic-query
openapi: 3.0.3
info:
  title: Atlantic API
  version: 0.1.0
servers:
  - url: https://atlantic.api.herodotus.cloud
    description: Production
  - url: https://stg.atlantic.api.herodotus.cloud
    description: Staging
security: []
paths:
  /atlantic-query:
    post:
      tags:
        - Atlantic Query
      summary: Submit a Atlantic query
      description: >-
        Submit a Atlantic query. You can choose to just generate a proof or
        generate and verify a proof. You can also choose to use a program file +
        input file (we will compute trace generation for you) or a pie file.
      parameters:
        - schema:
            type: string
          in: query
          name: apiKey
          required: false
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                externalId:
                  type: string
                  description: >-
                    The external id of the query, you can use it to track the
                    query
                  default: ''
                dedupId:
                  type: string
                  description: The dedup id of the query
                  nullable: true
                  default: null
                sharpProver:
                  type: string
                  enum:
                    - stone
                    - stwo
                  default: stone
                  description: The prover to use for the proof generation
                layout:
                  type: string
                  enum:
                    - auto
                    - plain
                    - recursive
                    - recursive_with_poseidon
                    - recursive_large_output
                    - all_solidity
                    - all_cairo
                    - dynamic
                    - small
                    - dex
                    - starknet
                    - starknet_with_keccak
                  default: auto
                cairoVm:
                  type: string
                  enum:
                    - rust
                    - python
                  default: rust
                cairoVersion:
                  type: string
                  enum:
                    - cairo0
                    - cairo1
                  default: cairo0
                result:
                  type: string
                  enum:
                    - TRACE_GENERATION
                    - PROOF_GENERATION
                    - PROOF_VERIFICATION_ON_L1
                    - PROOF_VERIFICATION_ON_L2
                    - PROOF_VERIFICATION_ON_APE_CHAIN
                    - PROOF_VERIFICATION_ON_WORLD_CHAIN
                  description: Describe what you want to achieve
                  default: PROOF_GENERATION
                mockFactHash:
                  type: string
                  enum:
                    - 'false'
                    - 'true'
                  description: >-
                    Used for proof verification, if true, a fact hash will be
                    mocked
                  default: 'false'
                network:
                  type: string
                  enum:
                    - MAINNET
                    - TESTNET
                  default: TESTNET
                hints:
                  anyOf:
                    - type: string
                      enum:
                        - herodotus_evm_grower
                        - herodotus_sn_grower
                    - type: string
                      enum:
                        - ''
                declaredJobSize:
                  type: string
                  enum:
                    - XS
                    - S
                    - M
                    - L
                  description: >-
                    Smaller jobs are cheaper, however your job might fail if you
                    choose a job size that is too small.
                programHash:
                  type: string
                  description: >-
                    To use the program you are interested in, you must first
                    register it. Registration occurs when you upload the program
                    file for the first time.
                  default: ''
                programFile:
                  type: string
                  format: binary
                inputFile:
                  type: string
                  format: binary
                pieFile:
                  type: string
                  format: binary
                proofFile:
                  type: string
                  format: binary
                bucketId:
                  type: string
                  nullable: true
                  description: >-
                    (Applicative Recursion) The id of the bucket you want to
                    submit the query to
                  default: ''
                bucketJobIndex:
                  type: number
                  nullable: true
                  description: >-
                    (Applicative Recursion) The index of the job inside the
                    bucket
                  default: null
              required:
                - declaredJobSize
              additionalProperties: false
        required: true
      responses:
        '201':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  atlanticQueryId:
                    type: string
                required:
                  - atlanticQueryId
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - MISSING_API_KEY
                      - EMAIL_NOT_VERIFIED
                      - PROGRAM_FILE_SHOULD_BE_JSON
                      - PROOF_FILE_SHOULD_BE_JSON
                      - INPUT_FILE_FOR_CAIRO0_SHOULD_BE_JSON
                      - INPUT_FILE_FOR_CAIRO1_SHOULD_BE_TXT
                      - INPUT_FILE_SHOULD_BE_JSON_OR_TXT
                      - PIE_FILE_SHOULD_BE_ZIP
                      - INVALID_FILE_MIME_TYPE
                      - ZOD_INVALID_BODY_STRING
                      - MISSING_BUCKET_JOB_INDEX
                      - ATLANTIC_BUCKET_JOB_ALREADY_EXISTS
                      - ATLANTIC_QUERY_WITH_DEDUP_ID_ALREADY_EXISTS
                      - CHAIN_NOT_SUPPORT_PROOF_VERIFICATION
                      - STWO_NOT_SUPPORTED_FOR_CHAIN
                      - CHAIN_IS_REQUIRED_FOR_PROOF_VERIFICATION
                      - PROGRAM_FILE_OR_PIE_FILE_OR_PROGRAM_HASH_IS_REQUIRED
                      - PROGRAM_NOT_FOUND
                      - CAIRO1_IS_NOT_SUPPORTED_FOR_PYTHON
                      - INPUT_FILE_IS_NOT_SUPPORTED_FOR_CAIRO0_AND_RUST_VM
                      - INVALID_LAYOUT_FOR_PROOF_VERIFICATION_ON_INTEGRITY_L2
                      - INVALID_AGGREGATOR_FOR_VM
                      - INSUFFICIENT_CREDITS
                      - EXCEEDED_CREDITS_LIMIT
                required:
                  - message
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - INVALID_API_KEY
                required:
                  - message
                additionalProperties: false
        '402':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  paymentRequired:
                    type: object
                    properties:
                      x402Version:
                        type: number
                        enum:
                          - 2
                      accepts:
                        type: array
                        items:
                          type: object
                          properties:
                            scheme:
                              type: string
                              enum:
                                - exact
                            network:
                              type: string
                            asset:
                              type: string
                            payTo:
                              type: string
                            amount:
                              type: string
                            resource:
                              type: string
                            statement:
                              type: string
                            mimeType:
                              type: string
                            maxTimeoutSeconds:
                              type: number
                            extra:
                              type: object
                              additionalProperties: {}
                          required:
                            - scheme
                            - network
                            - asset
                            - payTo
                            - amount
                            - resource
                            - mimeType
                          additionalProperties: false
                      error:
                        type: string
                    required:
                      - x402Version
                      - accepts
                      - error
                    additionalProperties: false
                  paymentRequiredHeader:
                    type: string
                required:
                  - paymentRequired
                  - paymentRequiredHeader
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - BUCKET_NOT_FOUND
                required:
                  - message
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - INTERNAL_SERVER_ERROR
                      - ZOD_PARSING_ERROR
                required:
                  - message
                additionalProperties: false
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api-key

````