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

# Create a response

> Send a prompt and receive a model response. Supports text generation, reasoning, web search, tool use, and streaming.



## OpenAPI

````yaml /openapi.json post /v1/responses
openapi: 3.0.3
info:
  title: AtlasFlux API
  description: >-
    Unified AI model routing API with intelligent model selection, web search,
    reasoning, and prepaid MYR billing.
  version: 1.0.0
  contact:
    name: Rainspeed Labs
    url: https://atlasflux.my
  license:
    name: Proprietary
servers:
  - url: https://api.atlasflux.my
    description: Production
security:
  - apiKeyAuth: []
paths:
  /v1/responses:
    post:
      tags:
        - Responses
      summary: Create a response
      description: >-
        Send a prompt and receive a model response. Supports text generation,
        reasoning, web search, tool use, and streaming.
      operationId: createResponse
      parameters:
        - name: Idempotency-Key
          in: header
          description: Optional idempotency key for non-streaming requests.
          required: false
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesBody'
            example:
              model: atlasflux/nenas-flash
              input: Explain what an API is.
              reasoning:
                effort: low
              max_output_tokens: 1024
      responses:
        '200':
          description: Response created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsesOutput'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientBalance'
        '403':
          $ref: '#/components/responses/PermissionDenied'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/RequestTooLarge'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/TemporaryProcessingError'
        '503':
          $ref: '#/components/responses/TemporaryProcessingError'
        '504':
          $ref: '#/components/responses/TemporaryProcessingError'
      security:
        - apiKeyAuth: []
components:
  schemas:
    ResponsesBody:
      type: object
      required:
        - input
      properties:
        model:
          type: string
          default: atlasflux/nenas-flash
        input:
          type: string
          description: The user prompt.
        reasoning:
          type: object
          properties:
            effort:
              type: string
              enum:
                - low
                - medium
                - high
              default: medium
        web_search:
          $ref: '#/components/schemas/WebSearchConfig'
        max_output_tokens:
          type: integer
          minimum: 1
          maximum: 32000
        max_total_cost_myr:
          type: number
          description: Maximum total cost in MYR.
        stream:
          type: boolean
          default: false
    ResponsesOutput:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          example: response
        created_at:
          type: integer
        status:
          type: string
          example: completed
        model:
          type: string
          example: atlasflux/nenas-flash
        output_text:
          type: string
        usage:
          $ref: '#/components/schemas/UsageInfo'
        request_id:
          type: string
        routing:
          $ref: '#/components/schemas/RoutingInfo'
        citations:
          type: array
          items:
            $ref: '#/components/schemas/Citation'
    WebSearchConfig:
      type: object
      properties:
        mode:
          type: string
          enum:
            - 'off'
            - auto
            - 'on'
          default: 'off'
        search_depth:
          type: string
          enum:
            - instant
            - fast
            - balanced
            - deep
            - reasoning
          default: fast
        max_results:
          type: integer
          minimum: 1
          maximum: 25
          default: 5
        max_searches:
          type: integer
          minimum: 1
          maximum: 5
          default: 2
        content:
          type: object
          properties:
            enabled:
              type: boolean
              default: false
            max_pages:
              type: integer
              minimum: 1
              maximum: 10
              default: 3
    UsageInfo:
      type: object
      properties:
        input_tokens:
          type: integer
        output_tokens:
          type: integer
        reasoning_tokens:
          type: integer
        cached_tokens:
          type: integer
        total_tokens:
          type: integer
        cost_myr:
          type: string
          description: Total cost in MYR as a string.
        latency_ms:
          type: integer
    RoutingInfo:
      type: object
      properties:
        category:
          type: string
          description: Routing category used (general, reasoning, etc.).
        upstream_model:
          type: string
          example: atlasflux/nenas-flash
          description: Internal model used (not exposed to users).
        reasoning:
          type: string
    Citation:
      type: object
      properties:
        index:
          type: integer
        title:
          type: string
        url:
          type: string
        published_at:
          type: string
          nullable: true
        accessed_at:
          type: string
    ErrorResponse:
      type: object
      required:
        - type
        - error
      properties:
        type:
          type: string
          enum:
            - error
        error:
          type: object
          required:
            - message
            - type
            - code
            - param
            - request_id
            - guidance
            - action_url
            - retryable
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: string
              enum:
                - invalid_request
                - authentication_error
                - invalid_api_key
                - expired_api_key
                - revoked_api_key
                - permission_denied
                - insufficient_balance
                - spend_limit_exceeded
                - rate_limit_exceeded
                - context_length_exceeded
                - unsupported_input
                - provider_unavailable
                - provider_timeout
                - search_error
                - billing_error
                - idempotency_conflict
                - not_implemented
                - internal_error
            param:
              type: string
              nullable: true
            request_id:
              type: string
            guidance:
              type: string
            action_url:
              type: string
              format: uri
              nullable: true
            retryable:
              type: boolean
            retry_after_seconds:
              type: integer
              minimum: 0
  responses:
    BadRequest:
      description: Invalid request body or parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InsufficientBalance:
      description: Insufficient wallet balance.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    PermissionDenied:
      description: The API key is not permitted to perform the operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Conflict:
      description: The request conflicts with a previous request or resource state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RequestTooLarge:
      description: The request body is too large.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Rate limit exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TemporaryProcessingError:
      description: >-
        AtlasFlux could not temporarily process the request. Retry according to
        the error guidance.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: af_live_... or af_test_...
      description: AtlasFlux API key. Get yours from the Developer Dashboard.

````

## Related topics

- [Create a chat completion](/api-reference/chat-completions/create-a-chat-completion.md)
- [Create an API key](/api-reference/dashboard-—-api-keys/create-an-api-key.md)
- [Create a Stripe checkout session](/api-reference/dashboard-—-billing/create-a-stripe-checkout-session.md)
- [API Reference](/api-reference/overview.md)
- [AtlasFlux API](/introduction.md)
