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

# Create a model response

> Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model's response.



## OpenAPI

````yaml post /api/gateway/v1/responses
openapi: 3.1.0
info:
  title: Waystone API
  description: Development documentation
  version: 1.0.0
servers:
  - url: http://localhost:3000
    description: Local server
security:
  - bearerAuth: []
paths:
  /api/gateway/v1/responses:
    post:
      summary: Create a model response
      description: >-
        Creates a model response. Provide text or image inputs to generate text
        or JSON outputs. Have the model call your own custom code or use
        built-in tools like web search or file search to use your own data as
        input for the model's response.
      operationId: postApiGatewayV1Responses
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  properties:
                    model:
                      type: string
                      examples:
                        - openai/gpt-4o-mini
                        - gpt-4o-mini
                      description: >-
                        <provider>/<model> to use in the query. If <model> is
                        unique across providers, can supply <model> only
                    metadata:
                      type: object
                      properties:
                        waystone:
                          type: string
                      additionalProperties:
                        type: string
                      description: >-
                        Key-value pairs of metadata for the request. Identify
                        end-users associated with the query with the `waystone`
                        metadata. All other fields are metadata for OpenAI
                        requests and are not used by Waystone.
                      examples:
                        - waystone: "{\n\t\t\t\t\t\t\"user\": {\n\t\t\t\t\t\t\t\"id\": \"user123\",\n\t\t\t\t\t\t\t\"metadata\": { \"email\": \"user@example.com\", \"name\": \"John Doe\" }\n\t\t\t\t\t\t}\n\t\t\t\t\t}"
                        - waystone: "{\n\t\t\t\t\t\t\"user\": \"user123\",\n\t\t\t\t\t\t\"group\": { \"id\": \"group123\", \"metadata\": { \"name\": \"Group Name\" } }\n\t\t\t\t\t}"
                    store:
                      type:
                        - boolean
                        - 'null'
                      default: false
                      description: >-
                        For OpenAI: Whether or not to store the output of this
                        chat completion request in OpenAI
                  required:
                    - model
                - type: object
                  properties:
                    stream:
                      type:
                        - boolean
                        - 'null'
                      default: false
                      description: >-
                        If set to true, the model response data will be streamed
                        to the client as it is generated
                    user:
                      type: string
                      description: >-
                        For OpenAI: A unique identifier representing your
                        end-user. NOT used by Waystone.
                    temperature:
                      type: number
                      default: 1
                      maximum: 2
                      minimum: 0
                      description: >-
                        What sampling temperature to use, between 0 and 2.
                        Higher values like 0.8 will make the output more random,
                        while lower values like 0.2 will make it more focused
                        and deterministic. We generally recommend altering this
                        or top_p but not both.
                    frequency_penalty:
                      type: number
                      default: 0
                      maximum: 2
                      minimum: -2
                      description: >-
                        Number between -2.0 and 2.0. Positive values penalize
                        new tokens based on their existing frequency in the text
                        so far, decreasing the model's likelihood to repeat the
                        same line verbatim.
                    max_completion_tokens:
                      type: number
                      description: >-
                        An upper bound for the number of tokens that can be
                        generated for a completion, including visible output
                        tokens and reasoning tokens.
                    'n':
                      type: number
                      default: 1
                      description: >-
                        How many chat completion choices to generate for each
                        input message. Note that you will be charged based on
                        the number of generated tokens across all of the
                        choices. Keep n as 1 to minimize costs.
                - type: object
                  properties:
                    input:
                      type: string
                  required:
                    - input
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````