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

# Create a response

> OpenAI's Responses API. The plan is left out. With `stream: true` the answer arrives as `text/event-stream`. Events follow OpenAI's Responses format, from `response.created` to `response.completed` or `response.incomplete`. There's no server-side conversation state: `previous_response_id` and `conversation` are rejected, `store: true` doesn't make responses retrievable, and past responses can't be fetched by ID, so send the full conversation each time. Notra still stores every request, with its prompt, the model's plan and answer, in the workspace's Logs; see https://www.usenotra.com/docs/platform/account/data-and-privacy.



## OpenAPI

````yaml /platform/openapi.json post /v1/responses
openapi: 3.1.0
info:
  title: Notra Labs Platform API
  version: 1.0.0
  description: >-
    OpenAI-compatible API for writer-0.1. Requests may have up to 500 messages
    and 1.45 MB of JSON. Docs: https://www.usenotra.com/docs/platform/overview.
    For agents: https://platform.usenotra.com/llms.txt.
servers:
  - url: https://platform.usenotra.com
security:
  - bearerAuth: []
tags:
  - name: Chat Completions
  - name: Responses
  - name: Models
paths:
  /v1/responses:
    post:
      tags:
        - Responses
      summary: Create a response
      description: >-
        OpenAI's Responses API. The plan is left out. With `stream: true` the
        answer arrives as `text/event-stream`. Events follow OpenAI's Responses
        format, from `response.created` to `response.completed` or
        `response.incomplete`. There's no server-side conversation state:
        `previous_response_id` and `conversation` are rejected, `store: true`
        doesn't make responses retrievable, and past responses can't be fetched
        by ID, so send the full conversation each time. Notra still stores every
        request, with its prompt, the model's plan and answer, in the
        workspace's Logs; see
        https://www.usenotra.com/docs/platform/account/data-and-privacy.
      operationId: createResponse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponseRequest'
            example:
              model: writer-0.1
              input: Write a changelog entry for faster search.
      responses:
        '200':
          description: The response, or a stream of events.
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
            text/event-stream:
              schema:
                type: object
                description: One server-sent event in OpenAI's Responses format.
                properties:
                  type:
                    type: string
                  sequence_number:
                    type: integer
        '400':
          description: >-
            `invalid_request`, `unsupported_parameter`,
            `context_length_exceeded`, `upstream_error`
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Fix the request; `param` names the field.
                  type: invalid_request_error
                  param: null
                  code: invalid_request
        '401':
          description: '`invalid_api_key`'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Check the key and the Authorization header.
                  type: invalid_request_error
                  param: null
                  code: invalid_api_key
        '402':
          description: '`insufficient_credits`'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    Add credits in the console, or lower the maximum answer
                    length.
                  type: invalid_request_error
                  param: null
                  code: insufficient_credits
        '404':
          description: '`model_not_found`'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Use a model from `GET /v1/models`.
                  type: invalid_request_error
                  param: null
                  code: model_not_found
        '405':
          description: '`method_not_allowed`'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Use POST for generation and GET for models.
                  type: invalid_request_error
                  param: null
                  code: method_not_allowed
        '413':
          description: '`request_too_large`, `upstream_error`'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Send at most 1.45 MB of JSON.
                  type: invalid_request_error
                  param: null
                  code: request_too_large
        '422':
          description: '`upstream_error`'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    At 400, 413 or 422 the model backend rejected the request:
                    fix it. At 502, retry with exponential backoff.
                  type: invalid_request_error
                  param: null
                  code: upstream_error
        '429':
          description: '`rate_limit_exceeded`'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    Wait for `retry-after` seconds; the `x-ratelimit-*` headers
                    show the limits.
                  type: invalid_request_error
                  param: null
                  code: rate_limit_exceeded
        '502':
          description: '`upstream_error`'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    At 400, 413 or 422 the model backend rejected the request:
                    fix it. At 502, retry with exponential backoff.
                  type: server_error
                  param: null
                  code: upstream_error
        '503':
          description: >-
            `model_starting`, `model_overloaded`, `model_unavailable`,
            `service_unavailable`
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Retry after `retry-after` seconds for up to 10 minutes.
                  type: server_error
                  param: null
                  code: model_starting
        '504':
          description: '`upstream_timeout`'
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Retry with exponential backoff, or stream the answer.
                  type: server_error
                  param: null
                  code: upstream_timeout
components:
  schemas:
    ResponseRequest:
      type: object
      required:
        - model
        - input
      x-notra-rejected-parameters:
        - stop
        - logit_bias
        - previous_response_id
        - conversation
        - background
        - prompt
      description: >-
        Parameters not listed here are ignored. `stop`, `logit_bias`,
        `previous_response_id`, `conversation`, `background`, `prompt` and tools
        other than functions are rejected with 400 `unsupported_parameter`.
      properties:
        model:
          type: string
          enum:
            - writer-0.1
        input:
          anyOf:
            - type: string
            - type: array
              minItems: 1
              maxItems: 500
              items:
                $ref: '#/components/schemas/ResponseInputItem'
        instructions:
          type: string
          description: The system prompt.
        max_output_tokens:
          type: integer
          minimum: 1
          description: >-
            Caps the output, plan included. Without `max_output_tokens` the
            model can write up to 32768 tokens. Larger values are lowered to
            32768 and to the room left in the 262144-token context window.
        stream:
          type: boolean
          default: false
          description: Stream the answer as server-sent events.
        text:
          type: object
          properties:
            format:
              $ref: '#/components/schemas/TextFormat'
        tools:
          type: array
          items:
            $ref: '#/components/schemas/ResponseTool'
        tool_choice:
          anyOf:
            - type: string
              enum:
                - auto
                - none
                - required
            - type: object
              required:
                - type
                - name
              properties:
                type:
                  type: string
                  const: function
                name:
                  type: string
        parallel_tool_calls:
          type: boolean
          description: Set to false to ask for at most one call.
        temperature:
          type: number
          minimum: 0
          maximum: 2
          description: >-
            Accepted and range-checked, but writer-0.1 samples with its own
            fixed settings, so it doesn't change the answer.
        top_p:
          type: number
          minimum: 0
          maximum: 1
          description: >-
            Accepted and range-checked, but writer-0.1 samples with its own
            fixed settings, so it doesn't change the answer.
        user:
          type: string
          description: Passed to the model.
        safety_identifier:
          type: string
          description: Passed to the model as `user`.
        metadata:
          type: object
          additionalProperties:
            type: string
    Response:
      type: object
      required:
        - id
        - object
        - created_at
        - status
        - model
        - output
      properties:
        id:
          type: string
          examples:
            - resp_abc123
        object:
          type: string
          const: response
        created_at:
          type: integer
        status:
          type: string
          enum:
            - completed
            - incomplete
        incomplete_details:
          anyOf:
            - type: object
              properties:
                reason:
                  type: string
                  const: max_output_tokens
            - type: 'null'
        model:
          type: string
        output:
          type: array
          items:
            anyOf:
              - title: Message
                type: object
                required:
                  - type
                  - id
                  - status
                  - role
                  - content
                properties:
                  type:
                    type: string
                    const: message
                  id:
                    type: string
                  status:
                    type: string
                  role:
                    type: string
                    const: assistant
                  content:
                    type: array
                    items:
                      type: object
                      required:
                        - type
                        - text
                      properties:
                        type:
                          type: string
                          const: output_text
                        text:
                          type: string
              - title: Function call
                type: object
                required:
                  - type
                  - id
                  - call_id
                  - name
                  - arguments
                  - status
                properties:
                  type:
                    type: string
                    const: function_call
                  id:
                    type: string
                  call_id:
                    type: string
                  name:
                    type: string
                  arguments:
                    type: string
                  status:
                    type: string
        usage:
          anyOf:
            - type: object
              properties:
                input_tokens:
                  type: integer
                input_tokens_details:
                  type: object
                  properties:
                    cached_tokens:
                      type: integer
                output_tokens:
                  type: integer
                  description: Output tokens, plan included.
                output_tokens_details:
                  type: object
                  properties:
                    reasoning_tokens:
                      type: integer
                      description: The plan's share of the output tokens.
                total_tokens:
                  type: integer
            - type: 'null'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
            - param
            - code
          properties:
            message:
              type: string
            type:
              type: string
              description: >-
                OpenAI's error type, such as `invalid_request_error`,
                `authentication_error`, `insufficient_quota`, `requests`,
                `tokens` or `server_error`.
            param:
              anyOf:
                - type: string
                  description: The request field that caused the error.
                - type: 'null'
            code:
              type: string
              enum:
                - invalid_request
                - unsupported_parameter
                - context_length_exceeded
                - invalid_api_key
                - insufficient_credits
                - model_not_found
                - method_not_allowed
                - request_too_large
                - rate_limit_exceeded
                - upstream_error
                - upstream_timeout
                - model_starting
                - model_overloaded
                - model_unavailable
                - service_unavailable
    ResponseInputItem:
      anyOf:
        - title: Message
          type: object
          required:
            - role
            - content
          properties:
            type:
              type: string
              const: message
            role:
              type: string
              enum:
                - user
                - assistant
                - system
                - developer
            content:
              anyOf:
                - type: string
                - type: array
                  items:
                    type: object
                    required:
                      - type
                      - text
                    properties:
                      type:
                        type: string
                        enum:
                          - input_text
                          - output_text
                          - text
                      text:
                        type: string
        - title: Function call
          type: object
          required:
            - type
            - call_id
            - name
            - arguments
          properties:
            type:
              type: string
              const: function_call
            call_id:
              type: string
            name:
              type: string
            arguments:
              type: string
        - title: Function call output
          type: object
          required:
            - type
            - call_id
            - output
          properties:
            type:
              type: string
              const: function_call_output
            call_id:
              type: string
            output:
              type: string
    TextFormat:
      anyOf:
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              const: text
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              const: json_object
        - title: JSON Schema
          type: object
          required:
            - type
            - name
            - schema
          properties:
            type:
              type: string
              const: json_schema
            name:
              type: string
              pattern: ^[a-zA-Z0-9_-]{1,64}$
            schema:
              type: object
              additionalProperties: true
            strict:
              type: boolean
            description:
              type: string
    ResponseTool:
      type: object
      required:
        - type
        - name
      properties:
        type:
          type: string
          const: function
        name:
          type: string
          pattern: ^[a-zA-Z0-9_-]{1,64}$
        description:
          type: string
        parameters:
          type: object
          description: A JSON Schema object for the function's arguments.
          additionalProperties: true
        strict:
          type: boolean
  headers:
    RequestId:
      description: The request's ID. Include it when you contact support.
      schema:
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An API key from the console, starting with `nl_live_` or `nl_test_`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.