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

# Design Api With Key



## OpenAPI

````yaml https://api.critique-labs.ai/openapi.json post /v1/design-api
openapi: 3.1.0
info:
  title: Critique Flow API
  summary: >-
    Gives you researched in-line cited search responses from Critique's in-built
    LLM powered agentic search engine
  description: >

    **URL**: `https://api.critique-labs.ai/v1/search`  

    **Method**: `POST`  

    **Content-Type**: `application/json`  


    #### Headers

    - **X-API-Key**: (Required) Your unique API key for authentication.

    - **Content-Type**: (Required) Should be set to `application/json`.


    #### Request Body Parameters

    | Parameter        | Type              |
    Description                                                                                                                                                                                                                        
    |

    |------------------|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

    | **image**        | `string` (optional) | A base64-encoded string of the
    image or a URL to the image. Providing this parameter allows the API to
    incorporate visual data into the search. If both `image` and `prompt` are
    included, they are combined to refine the search. |

    | **prompt**       | `string`          | A natural language question or
    statement that specifies the information you are seeking. The prompt can
    include specific instructions about the expected answer type, timeframe, or
    content source.                                  |

    | **source_blacklist** | `array` of `string` (optional) | A list of URLs or
    domains (e.g., `"expedia.com"`) that should be excluded from the search
    results. Cannot be used together with
    source_whitelist.                              |

    | **source_whitelist** | `array` of `string` (optional) | A list of URLs or
    domains that should be exclusively used in the search results. Cannot be
    used together with source_blacklist.                              |

    | **output_format**   | `object` (optional) | A JSON object that specifies
    the expected structure of the response. This allows for control over the
    format and detail level of the results, making integration into structured
    applications seamless. See details below.      |


    #### `output_format` Parameter

    The `output_format` parameter is a JSON object that defines the desired
    structure of the API response. Each key in this object represents a field in
    the response, and the value defines its data type or structure.


    ##### Supported Data Types

    - **Primitive Types**: `"string"`, `"number"`, `"boolean"`

    - **Nested Objects**: An object can have other fields, each with types or
    nested structures.

    - **Arrays of Objects**: Arrays can contain objects with defined structures.


    ##### Example of `output_format`

    ```json

    {
      "flights": [
        {
          "destination": "string",
          "price": "number",
          "date": "string"
        }
      ],
      "summary": "string",
      "isAvailable": "boolean"
    }

    ```


    In this example:

    - `flights` is an array where each object has `destination` (a string),
    `price` (a number), and `date` (a string).

    - `summary` is a single string.

    - `isAvailable` is a boolean value.


    ##### Request Example

    Here's an example request using the parameters defined:


    ```json

    {
      "image": "https://cdn.britannica.com/95/94195-050-FCBF777E/Golden-Gate-Bridge-San-Francisco.jpg",
      "prompt": "What are the current flight prices to this location from Hong Kong?",
      "source_blacklist": ["expedia.com"],
      "output_format": {
        "flights": [
          {
            "destination": "string",
            "price": "number",
            "date": "string"
          }
        ],
        "response": "string"
      }
    }

    ```


    In this request:

    - `image` provides an image URL.

    - `prompt` specifies the information sought.

    - `source_blacklist` excludes results from `"expedia.com"`.

    - `output_format` requests a structured response with `flights` (each with
    `destination`, `price`, and `date`) and an additional `response` as a
    summary string.


    #### Response

    The API returns a JSON object formatted according to the `output_format`,
    providing flexibility in structuring the data based on application needs.
  termsOfService: https://api.critique-labs.ai/en/docs/terms-of-service
  contact:
    email: support@critique-labs.ai
  version: 1.5.0
  x-logo:
    url: >-
      https://critique-labs.ai/_next/image?url=%2Fimages%2Ficon_only.png&w=96&q=75
servers:
  - url: https://api.critique-labs.ai
  - url: http://localhost
security: []
paths:
  /v1/design-api:
    post:
      summary: Design Api With Key
      operationId: design_api_with_key_v1_design_api_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DesignedApiInput'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - api_key: []
components:
  schemas:
    DesignedApiInput:
      properties:
        id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Id
        original_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Original Prompt
          default: ''
        template_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Template Prompt
          default: ''
        inputs:
          anyOf:
            - items:
                type: object
              type: array
            - type: 'null'
          title: Inputs
          default: []
        output_format:
          anyOf:
            - type: object
            - type: 'null'
          title: Output Format
          default: {}
        api_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Api Name
          default: ''
        stub:
          anyOf:
            - type: string
            - type: 'null'
          title: Stub
          default: ''
        nodes:
          anyOf:
            - items:
                $ref: '#/components/schemas/ApiGraphNode'
              type: array
            - type: 'null'
          title: Nodes
          default: []
        edges:
          anyOf:
            - items:
                $ref: '#/components/schemas/ApiGraphEdge'
              type: array
            - type: 'null'
          title: Edges
          default: []
      type: object
      title: DesignedApiInput
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ApiGraphNode:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        type:
          type: string
          title: Type
        name:
          type: string
          title: Name
        system_prompt:
          type: string
          title: System Prompt
        output_format:
          type: object
          title: Output Format
        configuration:
          anyOf:
            - type: object
            - type: 'null'
          title: Configuration
          default: {}
      type: object
      required:
        - id
        - type
        - name
        - system_prompt
        - output_format
      title: ApiGraphNode
    ApiGraphEdge:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        source:
          type: string
          title: Source
        target:
          type: string
          title: Target
      type: object
      required:
        - source
        - target
      title: ApiGraphEdge
    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:
    api_key:
      type: apiKey
      description: >-
        Your API key for authentication. Get one at
        https://critique-labs.ai/en/dashboard
      in: header
      name: X-API-Key

````