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

# Search Agent Result API Reference

> Returns a Search Agent task by id.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/agent/{task_id}
openapi: 3.1.0
info:
  title: Octen API
  description: >-
    Octen API provides Broad Search, Web Search, Image Search, Video Search,
    Extract, Embeddings, VL Embeddings, Answer, and Deep Research services. The
    Web Search API searches ranked web results with optional filters,
    highlights, and full content. The Image Search API searches for images from
    a text query or an image. The Video Search API searches for videos from a
    text query. The Broad Search API decomposes a query into multiple
    sub-queries, searches them in parallel, and returns results grouped by
    sub-query. The Extract API extracts clean content from URLs, with optional
    query-focused highlights, page classification, and multimedia resources. The
    Embeddings API converts text into vector representations. The VL Embeddings
    API converts multimodal inputs into vector representations. The Answer API
    decomposes queries into multiple sub-queries for comprehensive search and
    synthesis. The Deep Research API runs a multi-round adaptive research
    pipeline that produces a structured research plan, executes iterative
    searches, and streams a final long-form report. The Pulse Search API
    generates the most likely URLs for a query in about 10ms, with optional
    highlights and full content in standard mode.
  version: 1.0.0
servers:
  - url: https://api.octen.ai
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /v1/agent/{task_id}:
    get:
      summary: Get a Search Agent result
      description: Returns a Search Agent task by id.
      operationId: get-search-agent
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
          example: agent-7f3c2a9e4b1d4c6f8a0e5b2d9c1f6a37
          description: The task id returned by the Search Agent API.
      responses:
        '200':
          description: Successful Search Agent task response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchAgentTask'
              examples:
                text:
                  summary: Text answer
                  value:
                    request_id: 20261016091305542P3VN8TQ6WE
                    task_id: agent-7f3c2a9e4b1d4c6f8a0e5b2d9c1f6a37
                    tier: low
                    status: succeeded
                    previous_task_id: null
                    stop_reason: schema_satisfied
                    choices:
                      - message:
                          role: assistant
                          content: >-
                            **The 2026 Nobel Prize in Physiology or Medicine was
                            awarded jointly to Karl Deisseroth, Peter Hegemann,
                            and Georg Nagel.**[^1] They were recognized “for
                            their discoveries concerning light-gated ion
                            channels and optogenetics.”[^1]
                          annotations:
                            - type: url_citation
                              url_citation:
                                url: >-
                                  https://www.nobelprize.org/prizes/medicine/2026/press-release/
                                title: >-
                                  Press release: Nobel Prize in Physiology or
                                  Medicine 2026 - NobelPrize.org
                                start_index: 123
                                end_index: 127
                            - type: url_citation
                              url_citation:
                                url: >-
                                  https://www.nobelprize.org/prizes/medicine/2026/press-release/
                                title: >-
                                  Press release: Nobel Prize in Physiology or
                                  Medicine 2026 - NobelPrize.org
                                start_index: 226
                                end_index: 230
                    created_at: 1793608513
                    completed_at: 1793608522
                    meta:
                      latency: 9376
                      billed_tier: low
                      cost: 0.05
                structuredOutput:
                  summary: Structured output
                  value:
                    request_id: 20261016092150863W4KD7NF2QX
                    task_id: agent-2b8e6d41c9a04f7e93d5a1c0e6b7f284
                    tier: low
                    status: succeeded
                    previous_task_id: null
                    stop_reason: schema_satisfied
                    choices:
                      - message:
                          role: assistant
                          content: >-
                            {"laureates":[{"name":"Karl
                            Deisseroth","affiliation":"Howard Hughes Medical
                            Institute; Stanford
                            University","nationality":"American"},{"name":"Peter
                            Hegemann","affiliation":"Humboldt University of
                            Berlin","nationality":"German"},{"name":"Georg
                            Nagel","affiliation":"University of
                            Würzburg","nationality":"German"}]}
                          annotations:
                            - type: url_citation
                              url_citation:
                                url: >-
                                  https://www.nobelprize.org/prizes/medicine/2026/deisseroth/facts/
                                title: >-
                                  Karl Deisseroth – Facts – 2026 -
                                  NobelPrize.org
                                start_index: 0
                                end_index: 316
                            - type: url_citation
                              url_citation:
                                url: >-
                                  https://www.nobelprize.org/prizes/medicine/2026/hegemann/facts/
                                title: Peter Hegemann – Facts – 2026 - NobelPrize.org
                                start_index: 0
                                end_index: 316
                    created_at: 1793608547
                    completed_at: 1793608562
                    meta:
                      latency: 12210
                      billed_tier: low
                      cost: 0.05
                failed:
                  summary: Failed task
                  value:
                    request_id: 20261016081012476M8TB5YH3RC
                    task_id: agent-c41a7e9052d34b8f9e6a0b3d7f1c5e28
                    tier: high
                    status: failed
                    previous_task_id: null
                    error:
                      code: AGENT_FAILED
                      message: Task failed, please retry
                    stop_reason: error
                    created_at: 1792137730
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: >-
            Task not found or expired — Returned when the task id does not exist
            or has expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 404
                msg: Task not found or expired.
                request_id: req_abc123def456
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    SearchAgentTask:
      type: object
      required:
        - request_id
        - task_id
        - tier
        - status
        - created_at
      properties:
        request_id:
          type: string
          description: Unique identifier for the request.
        task_id:
          type: string
          description: Unique task id.
        tier:
          type: string
          enum:
            - auto
            - low
            - medium
            - high
          description: The tier from the request.
        status:
          type: string
          enum:
            - queued
            - running
            - succeeded
            - failed
            - cancelled
          description: Task state.
        previous_task_id:
          type:
            - string
            - 'null'
          description: The `previous_task_id` from the request.
        stop_reason:
          $ref: '#/components/schemas/SearchAgentStopReason'
        choices:
          type: array
          description: A list of completion choices, present when `status` is `succeeded`.
          items:
            $ref: '#/components/schemas/SearchAgentChoice'
        error:
          $ref: '#/components/schemas/SearchAgentError'
        created_at:
          type: integer
          description: Unix timestamp in seconds when the task was created.
        completed_at:
          type: integer
          description: Unix timestamp in seconds when the task finished.
        meta:
          $ref: '#/components/schemas/SearchAgentMeta'
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: Business status code. Non-zero values indicate an error.
        msg:
          type: string
          description: A message describing the error.
        request_id:
          type: string
          description: Unique identifier for the request.
      required:
        - code
        - msg
        - request_id
    SearchAgentStopReason:
      type: string
      enum:
        - schema_satisfied
        - stopped
        - budget_reached
        - time_limit_reached
        - cancelled
        - error
      description: >-
        Why the task stopped. `schema_satisfied`: completed normally; `stopped`:
        stopped on request; `budget_reached` / `time_limit_reached`: wrapped up
        early after reaching an internal budget or time limit; `cancelled`:
        cancelled; `error`: failed.
    SearchAgentChoice:
      type: object
      description: A single completion choice in a non-streaming response.
      properties:
        message:
          type: object
          description: The assistant's response message.
          properties:
            role:
              type: string
              enum:
                - assistant
              description: The role of the message author. Always `assistant`.
            content:
              type: string
              description: >-
                The assistant's text content. A JSON string when
                `response_format.type` is `json_schema`.
            annotations:
              type: array
              description: Citation annotations.
              items:
                $ref: '#/components/schemas/SearchAgentAnnotation'
    SearchAgentError:
      type: object
      description: >-
        Failure reason, present when `status` is `failed`. Failed tasks are not
        billed.
      properties:
        code:
          type: string
          enum:
            - AGENT_TIMEOUT
            - AGENT_FAILED
          description: >-
            `AGENT_TIMEOUT`: the task timed out; `AGENT_FAILED`: the task failed
            for another reason.
        message:
          type: string
          description: A message describing the failure.
    SearchAgentMeta:
      type: object
      description: Metadata for the Search Agent response.
      properties:
        latency:
          type: integer
          description: Total request latency in milliseconds.
        billed_tier:
          type: string
          enum:
            - auto
            - low
            - medium
            - high
          description: The tier actually billed for this request.
        cost:
          type: number
          description: Amount charged for this task in USD.
    SearchAgentAnnotation:
      type: object
      description: A citation annotation.
      properties:
        type:
          type: string
          enum:
            - url_citation
          description: The annotation type.
        url_citation:
          type: object
          properties:
            url:
              type: string
              description: The URL of the cited source.
            title:
              type: string
              description: The title of the cited source.
            start_index:
              type: integer
              description: Start position of the cited span in `content`.
            end_index:
              type: integer
              description: End position of the cited span in `content`.
  responses:
    Unauthorized:
      description: Invalid API Key — Returned when the API key is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 401
            msg: Invalid API Key
            request_id: req_abc123def456
    RateLimited:
      description: >-
        Exceeding the rate limit — Returned when the request exceeds the
        configured rate limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 429
            msg: Exceeding the rate limit
            request_id: req_abc123def456
    InternalError:
      description: Internal error — Returned when an unexpected server-side error occurs.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 500
            msg: Internal error
            request_id: req_abc123def456
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token used for request authentication. Alternatively, you can
        send the API key in the `x-api-key` header. Note: A payment method is
        required to use the API.
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key used for request authentication. Alternatively, you can send the
        key as a Bearer token in the `Authorization` header. Note: A payment
        method is required to use the API.

````

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