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

# Answer

> Deprecated. POST /v1/answer sunsets on December 17, 2026. Migrate to DeepResearch instant mode or to Search with your own model.

> [!WARNING]
>
> The Answer API is deprecated as of November 17, 2026. It sunsets on December 17, 2026: from that date `POST /v1/answer` returns HTTP `410 Gone`. Until then it keeps working. Move to [DeepResearch `instant` mode](#migrate-from-answer) or to Search with your own model.

Ask a question and receive a synthesized answer with supporting sources. Use Answer when you want Valyu to retrieve and write the response; use [Search](https://docs.valyu.ai/api-reference/endpoint/search.md) when your own application should do that work.

## Consume the stream

The HTTP endpoint returns server-sent events, not one JSON response. Handle `search_results`, `content` and `metadata` events, followed by `[DONE]`. If the answer fails mid-stream, you receive `{"error": "Streaming failed"}` and the stream ends, even though the HTTP status was `200`. Keep the returned sources with the answer. The `metadata` event also carries any [warnings](https://docs.valyu.ai/api-reference/warnings.md) from the searches the answer ran.

There is no per-request fee. Each answer is charged for the search, content extraction and AI processing it uses, and `cost.total_deduction_dollars` in the final `metadata` event is the amount billed.

Source and date controls narrow retrieval. They do not guarantee that every claim is supported or that all relevant evidence was found. For a longer asynchronous investigation with a report and optional files, use [DeepResearch](https://docs.valyu.ai/api-reference/endpoint/deepresearch-create.md).

## Migrate from Answer

Answer calls that you do not move by December 17, 2026 fail with HTTP `410`. Responses from `POST /v1/answer` before that date carry these headers:

| Header | Value |
| - | - |
| `Deprecation` | Marks the endpoint as deprecated. |
| `Sunset` | `Thu, 17 Dec 2026 00:00:00 GMT` |

The `Link` header points to this section. Valyu SDK `answer()` methods log a deprecation warning from valyu-py 2.13.8 and valyu-js 2.11.8.

Pick the replacement that fits how you use Answer.

| You use Answer to | Move to |
| - | - |
| Get a short cited answer to a focused question | [DeepResearch](https://docs.valyu.ai/api-reference/endpoint/deepresearch-create.md) with `mode: "instant"` |
| Control the model, prompt and streaming yourself | [Search](https://docs.valyu.ai/api-reference/endpoint/search.md) plus your own LLM |

### DeepResearch instant mode

`instant` mode returns a short cited answer in under 30 seconds and uses 8 credits per task. You create a task, then read its status until it completes. It is not a server-sent event stream. The result has the answer in `output` (markdown with numbered citations) and the sources in `sources`.

| Answer | DeepResearch |
| - | - |
| `query` | `query` |
| `search_type`, `included_sources`, `excluded_sources`, `country_code`, `start_date`, `end_date` | Same names inside the `search` object |
| `data_max_price`, `fast_mode`, `structured_output` | No direct match. Use `mode` to set depth and cost, and `output_formats` for structured output. |
| `system_instructions` | `report_format` |

```bash curl theme={null}
curl https://api.valyu.ai/v1/deepresearch/tasks \
  -H "x-api-key: $VALYU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "How do public companies describe supply chain concentration risks?", "mode": "instant"}'

# Save deepresearch_id from the response, then poll until status is completed.
curl https://api.valyu.ai/v1/deepresearch/tasks/$DEEPRESEARCH_ID/status \
  -H "x-api-key: $VALYU_API_KEY"
```

```python Python theme={null}
from valyu import Valyu

valyu = Valyu()

task = valyu.deepresearch.create(
    query="How do public companies describe supply chain concentration risks?",
    mode="instant",
)
if not task.success:
    raise RuntimeError(task.error)

result = valyu.deepresearch.wait(task.deepresearch_id)
if result.status == "completed":
    print(result.output)
    for source in result.sources or []:
        print(source.title, "-", source.url)
```

```typescript TypeScript theme={null}
import { Valyu } from "valyu-js";

const valyu = new Valyu();

const task = await valyu.deepresearch.create({
  query: "How do public companies describe supply chain concentration risks?",
  mode: "instant",
});
if (!task.success || !task.deepresearch_id) throw new Error(task.error);

const result = await valyu.deepresearch.wait(task.deepresearch_id);
if (result.status === "completed") {
  console.log(result.output);
  for (const source of result.sources ?? []) console.log(source.title, "-", source.url);
}
```

Check `status` before you read `output`. For longer research, pick another [mode](https://docs.valyu.ai/guides/deepresearch.md).

### Search plus your own LLM

Use [Search](https://docs.valyu.ai/api-reference/endpoint/search.md) to get ranked results with `title`, `url` and `content`, then pass them to your own model. Keep the `url` with each passage so the answer can cite it.

```python Python theme={null}
from valyu import Valyu

valyu = Valyu()

response = valyu.search("How do public companies describe supply chain concentration risks?", max_num_results=8)
if not response.success:
    raise RuntimeError(response.error)

context = "\n\n".join(f"[{i + 1}] {r.title} ({r.url})\n{r.content}" for i, r in enumerate(response.results))
prompt = f"Answer the question using only the numbered sources and cite them as [n].\n\n{context}"
# Send `prompt` to your own model.
```

```typescript TypeScript theme={null}
import { Valyu } from "valyu-js";

const valyu = new Valyu();

const response = await valyu.search(
  "How do public companies describe supply chain concentration risks?",
  { maxNumResults: 8 }
);
if (!response.success) throw new Error(response.error);

const context = response.results
  .map((r, i) => `[${i + 1}] ${r.title} (${r.url})\n${typeof r.content === "string" ? r.content : JSON.stringify(r.content)}`)
  .join("\n\n");
const prompt = `Answer the question using only the numbered sources and cite them as [n].\n\n${context}`;
// Send `prompt` to your own model.
```


## OpenAPI

````yaml POST /v1/answer
openapi: 3.0.3
info:
  title: Valyu API
  version: 2.3.0
  description: >
    The search API built for AI agents. One API that gives your AI unified
    access to web search, academic papers, financial data, SEC filings, clinical
    trials, patents, genomics, and 40+ proprietary data sources.


    ## Products


    | Product | Endpoint | Description |

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

    | **Search** | `POST /v1/search` | Multi-source search across web and
    proprietary datasets |

    | **Contents** | `POST /v1/contents` | Extract clean, structured content
    from URLs |

    | **Answer** | `POST /v1/answer` | AI-powered answers with real-time search
    |

    | **DeepResearch** | `POST /v1/deepresearch/tasks` | Async research agents
    for comprehensive analysis |

    | **Workflows** (Beta) | `GET /v1/workflows` | Templated, versioned
    DeepResearch for repeatable knowledge work |

    | **Datasources** | `GET /v1/datasources` | Discover available data sources
    and their schemas |


    ## Authentication


    All endpoints require an API key passed via the `X-API-Key` header (the
    lowercase `x-api-key` form is also accepted). Get your key at
    [platform.valyu.ai](https://platform.valyu.ai).


    ```

    X-API-Key: your_api_key_here

    ```


    ## Pricing


    Pay per use in credits. One credit balance covers every API.

    - **Search**: priced per result returned. Web and news results use 0.1
    credits each (100 per 1,000 results). arXiv, PubMed, bioRxiv and medRxiv use
    0.05 credits each (50 per 1,000). Other datasets have their own price per
    1,000 results, listed in `GET /v1/datasources` (`pricing.cpm`).

    - **Contents**: 0.2 credits per successfully extracted URL. Any AI
    processing (a text summary or structured extraction through `summary`)
    brings the price to 0.6 credits per URL in total, the same for both. Failed
    URLs are free.

    - **Answer**: no per-request fee. You pay for the search, content extraction
    and AI processing each answer uses, reported in
    `cost.total_deduction_dollars`.

    - **DeepResearch**: fixed price per task by mode: instant 8 credits, fast
    25, standard 100, heavy 500, max 2,500, plus tool add-ons.


    Every plan includes web search and open academic sources. Paid plans unlock
    specialist sources such as SEC filings, clinical trials, patents and
    genomics. See [pricing](https://docs.valyu.ai/pricing) for plans and free
    credits.


    ## Rate limits


    Limits apply per organisation: 10 requests per second with bursts up to 20,
    and 86,400 requests per day by default. Enterprise plans can raise them. A
    request over the limit is currently rejected with `403 Forbidden` and the
    body `{"error": "Forbidden", "message": "Access denied - API key is invalid,
    disabled, or revoked"}`. If a key that otherwise works starts receiving 403
    under load, reduce concurrency and retry with exponential backoff.


    ## SDKs


    - [Python SDK](https://pypi.org/project/valyu/) - `pip install valyu`

    - [TypeScript SDK](https://www.npmjs.com/package/valyu-js) - `npm install
    valyu-js`
  contact:
    name: Valyu Support
    url: https://valyu.ai
    email: support@valyu.ai
  x-logo:
    url: https://valyu.ai/logo.png
    altText: Valyu
servers:
  - url: https://api.valyu.ai
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Search
    description: >-
      Search across web, academic, financial, and proprietary data sources.
      Returns results ready for RAG pipelines, AI agents, and applications.
    externalDocs:
      description: Search API Guide
      url: https://docs.valyu.ai/search/quickstart
  - name: Contents
    description: >-
      Extract clean, structured content from web pages at scale. Supports batch
      processing, AI-powered summaries, structured extraction via JSON schemas,
      and async jobs for large URL sets.
    externalDocs:
      description: Contents API Guide
      url: https://docs.valyu.ai/guides/content-extraction
  - name: Answer
    description: >-
      Get AI-powered answers grounded in real-time search results. The Answer
      API searches across web, academic, and financial sources, then uses AI to
      generate a readable response via Server-Sent Events streaming.
    externalDocs:
      description: Answer API Guide
      url: https://docs.valyu.ai/guides/answer-api
  - name: DeepResearch
    description: >-
      Async research agents that perform comprehensive, multi-step research.
      DeepResearch searches multiple sources, analyzes content, and generates
      detailed reports with citations. Tasks run in the background and can take
      minutes to complete.
    externalDocs:
      description: DeepResearch Guide
      url: https://docs.valyu.ai/guides/deepresearch
  - name: Batches
    description: >-
      Run multiple DeepResearch tasks in parallel with shared configuration,
      unified monitoring, and aggregated cost tracking.
    externalDocs:
      description: Batch API Guide
      url: https://docs.valyu.ai/guides/deepresearch-batch-quickstart
  - name: Workflows
    description: >-
      **Beta.** Templated, versioned DeepResearch for repeatable knowledge work
      - earnings previews, diligence reads, market sizings. A workflow bundles a
      prompt template with typed variables, a research strategy, report format,
      deliverables, tools, and a recommended mode. Workflows are immutably
      versioned; runs can pin a version. Two scopes exist: your organization's
      private workflows and curated Valyu workflows available to everyone. Run a
      workflow by passing `workflow_id` + `workflow_params` to `POST
      /v1/deepresearch/tasks` - same auth, billing, and task lifecycle as
      freeform DeepResearch.
    externalDocs:
      description: Workflows Guide (Beta)
      url: https://docs.valyu.ai/guides/workflows
  - name: Datasources
    description: >-
      Discover available data sources and their schemas. A tool manifest for AI
      agents - instead of hardcoding knowledge of available datasets, agents can
      query this API to discover sources, filter by category, and use
      `example_queries` for few-shot prompting.
    externalDocs:
      description: Datasources Guide
      url: https://docs.valyu.ai/guides/datasources
externalDocs:
  description: Complete API Documentation
  url: https://docs.valyu.ai
paths:
  /v1/answer:
    post:
      tags:
        - Answer
      summary: Get AI-powered answers with real-time search
      description: >-
        **Deprecated.** The Answer API sunsets on 2026-12-17. From that date
        this endpoint returns HTTP `410 Gone`. Until then it keeps working and
        its responses carry `Deprecation` and `Sunset` headers. For quick cited
        answers, use
        [DeepResearch](https://docs.valyu.ai/api-reference/endpoint/deepresearch-create)
        with `mode: "instant"`, or use
        [Search](https://docs.valyu.ai/api-reference/endpoint/search) with your
        own model. See [Migrate from
        Answer](https://docs.valyu.ai/api-reference/endpoint/answer#migrate-from-answer).


        Searches across web, academic, and financial sources, then uses AI to
        generate a readable, cited response. Returns results as a **Server-Sent
        Events (SSE)** stream.


        The AI agent performs multi-round search with up to 2 tool call rounds
        (3 in `fast_mode`), can decompose queries into sub-queries, and
        synthesizes findings into a coherent answer.


        ## SSE Event Types


        Events are sent as `data: {json}\n\n` with the following types:


        | Event | Description |

        | --- | --- |

        | `search_results` | Search sources found (may occur multiple times) |

        | `content` | Partial answer text chunk (OpenAI-compatible delta format)
        |

        | `metadata` | Final metadata with costs, token usage, all search
        results and any `warnings` |

        | `error` | `{"error": "Streaming failed"}` if the answer fails
        mid-stream; the stream then ends |

        | `[DONE]` | Stream complete |


        ## Cost Structure


        There is no per-request fee. Each answer is charged for the search,
        content extraction and AI processing it uses.
        `cost.total_deduction_dollars` in the final `metadata` event is the
        amount billed, and each search result is billed once per answer.
        `data_max_price` caps only the search component, not the entire charge.
      operationId: answer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnswerRequest'
            examples:
              basic:
                summary: Basic question
                value:
                  query: >-
                    What are the latest FDA-approved treatments for type 2
                    diabetes?
              structured:
                summary: Structured output with JSON schema
                value:
                  query: >-
                    Compare the top 5 electric vehicles by range and price in
                    2024
                  structured_output:
                    type: object
                    properties:
                      vehicles:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            range_miles:
                              type: number
                            base_price:
                              type: number
              filtered:
                summary: Source-filtered with custom instructions
                value:
                  query: SEC enforcement actions against crypto exchanges
                  search_type: proprietary
                  included_sources:
                    - finance
                  system_instructions: >-
                    You are a financial regulatory analyst. Focus on enforcement
                    actions and penalties.
                  start_date: '2024-01-01'
      responses:
        '200':
          description: SSE stream of search results, answer chunks, and metadata.
          content:
            text/event-stream:
              schema:
                type: string
                description: >-
                  Server-Sent Events stream. Each event has format: `data:
                  {json}\n\n`


                  **search_results event:**

                  ```json

                  {"search_results": [{"title": "...", "url": "...", "content":
                  "...", ...}]}

                  ```


                  **content event (OpenAI-compatible):**

                  ```json

                  {"choices": [{"delta": {"role": "assistant", "content": "text
                  chunk"}, "index": 0}]}

                  ```


                  **metadata event:**

                  ```json

                  {"success": true, "tx_id": "ai_tx_...", "original_query":
                  "...", "contents": "Full answer text...", "search_results":
                  [{"title": "...", "url": "...", "content": "...",
                  "description": "...", "source": "web", "source_type":
                  "website", "data_type": "unstructured", "date": "...",
                  "length": 1200, "image_url": {}}], "search_metadata":
                  {"tx_ids": ["tx_..."], "number_of_results": 10,
                  "total_characters": 50000}, "ai_usage": {"input_tokens":
                  15000, "output_tokens": 2000}, "cost":
                  {"total_deduction_dollars": 0.0475,
                  "search_deduction_dollars": 0.00625, "ai_deduction_dollars":
                  0.03625, "contents_deduction_dollars": 0.005}}

                  ```


                  `contents` is the full answer (JSON text when
                  `structured_output` is set). `total_deduction_dollars` is the
                  amount billed. When the searches behind the answer skipped or
                  adjusted something, the metadata event also carries
                  `warnings`: the warnings of those searches, deduplicated, in
                  the same `{type, message, detail}` shape as Search. See
                  [Warnings](https://docs.valyu.ai/api-reference/warnings).


                  **error event:**

                  ```json

                  {"error": "Streaming failed"}

                  ```


                  **done signal:**

                  ```

                  data: [DONE]

                  ```
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalServerError'
      deprecated: true
components:
  schemas:
    AnswerRequest:
      type: object
      required:
        - query
      additionalProperties: false
      description: Answer API request parameters.
      properties:
        query:
          type: string
          description: The question or research query to answer.
          example: What are the latest FDA-approved treatments for type 2 diabetes?
        search_type:
          type: string
          description: |-
            Controls which data sources are searched.

            - `all` - Web and proprietary sources (default)
            - `web` - Web search only
            - `proprietary` - Academic, financial, and premium sources only
            - `news` - News articles only
          enum:
            - all
            - web
            - proprietary
            - news
          default: all
        included_sources:
          type: array
          description: >-
            Sources to include. Accepts domains, URLs, dataset identifiers, or
            presets (`"finance"`, `"medical"`).
          items:
            type: string
          example:
            - pubmed.ncbi.nlm.nih.gov
        excluded_sources:
          type: array
          description: >-
            Sources to exclude. Accepts domains, URLs and dataset identifiers.
            Presets are not supported.
          items:
            type: string
        data_max_price:
          type: number
          description: >-
            Maximum budget for the search component of the answer. It does not
            cap content extraction or AI processing.
          default: 1
          minimum: 0
          exclusiveMinimum: true
          example: 1
        start_date:
          type: string
          format: date
          description: >-
            Filter results published on or after this date. Format:
            `YYYY-MM-DD`.
          example: '2024-01-01'
        end_date:
          type: string
          format: date
          description: >-
            Filter results published on or before this date. Format:
            `YYYY-MM-DD`.
          example: '2024-12-31'
        country_code:
          type: string
          description: ISO 3166-1 alpha-2 country code for geo-targeted search.
          enum:
            - ALL
            - AR
            - AU
            - AT
            - BE
            - BR
            - CA
            - CL
            - DK
            - FI
            - FR
            - DE
            - HK
            - IN
            - ID
            - IT
            - JP
            - KR
            - MY
            - MX
            - NL
            - NZ
            - 'NO'
            - CN
            - PL
            - PT
            - PH
            - RU
            - SA
            - ZA
            - ES
            - SE
            - CH
            - TW
            - TR
            - GB
            - US
        fast_mode:
          type: boolean
          description: >-
            Enable fast mode for lower latency. Uses 3 tool call rounds instead
            of 2 and higher result counts per query.
          default: false
        structured_output:
          type: object
          nullable: true
          description: >-
            JSON Schema defining the desired output structure. When set, the AI
            returns a JSON object matching this schema instead of free-form
            text. Max depth 10, max 50 properties, max 5000 characters.
          example:
            type: object
            properties:
              treatments:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                    approval_date:
                      type: string
                    mechanism:
                      type: string
        system_instructions:
          type: string
          nullable: true
          description: >-
            Custom system instructions for the AI. Replaces the default research
            agent prompt. Max 2000 characters.
          maxLength: 2000
          example: You are a medical research assistant. Cite all sources.
    Error:
      type: object
      description: >-
        Error response. Every error body has `error`. Search, Contents, Answer
        and Datasources errors usually also carry `success: false`. Errors
        returned before a request reaches the endpoint (missing, invalid or
        disabled keys, rate limits) and DeepResearch errors have no `success`
        field. Some errors add a machine-readable `code` and a `recovery`
        object.
      required:
        - error
      properties:
        success:
          type: boolean
          description: '`false` when present.'
          example: false
        error:
          type: string
          description: >-
            Error message, or a machine-readable code for some errors (for
            example `invalid_scope_policy`, or `rate_limited` on a `429`).
          example: Invalid request parameters
        message:
          type: string
          description: >-
            Human-readable detail. Present on errors returned before the request
            reaches the endpoint.
        code:
          type: string
          description: >-
            Stable machine-readable error code, when available. Branch on this
            rather than on the message text.
          example: insufficient_credits
        recovery:
          type: object
          description: Links or details that help resolve the error, when available.
          additionalProperties: true
        transaction_id:
          type: string
          description: Transaction ID for support, when available.
  responses:
    BadRequest:
      description: The request was malformed or contained invalid parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            example:
              summary: Invalid parameters
              value:
                success: false
                error: >-
                  Invalid search_type. Must be 'all', 'web', 'proprietary', or
                  'news'
    Unauthorized:
      description: Missing or invalid API key. Send your key in the `X-API-Key` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing_or_invalid:
              summary: Missing or invalid API key
              value:
                error: Unauthorized
                message: API key is missing or invalid
            invalid_key:
              summary: Invalid API key (endpoint response)
              value:
                success: false
                error: Invalid API key
    PaymentRequired:
      description: >-
        The request can't be paid for. Nothing is charged.


        `code` tells you why:

        - `insufficient_credits` - the balance is used up. Top up, or wait for
        your plan's monthly allowance to renew.

        - `credit_limit_reached` - the organisation's optional monthly usage
        limit is reached. Raise the limit in the dashboard.

        - `spend_cap_reached` - this API key's budget cap is reached. Raise the
        key's cap or use another key.


        Search, Contents and Answer return the body shown in the examples.
        `error` is a sentence you can relay that ends with the link that fixes
        it, and `recovery` repeats the links. Below the top self-serve plan,
        `insufficient_credits` also carries `upgrade_url`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            insufficient_credits:
              summary: Balance exhausted
              value:
                success: false
                error: >-
                  Your credit balance is used up. Nothing was charged. Top up to
                  continue:
                  https://platform.valyu.ai/user/account/billing?tab=credits
                  Monthly plans give you cheaper credits and more data sources:
                  https://platform.valyu.ai/user/account/billing?tab=plan
                code: insufficient_credits
                recovery:
                  topup_url: https://platform.valyu.ai/user/account/billing?tab=credits
                  topup_api: POST https://api.valyu.ai/v1/account/balance/topup
                  upgrade_url: https://platform.valyu.ai/user/account/billing?tab=plan
                transaction_id: tx_a1b2c3d4-e5f6-7890-abcd-ef1234567890
            credit_limit_reached:
              summary: Monthly usage limit reached
              value:
                success: false
                error: >-
                  Your organisation's monthly credit limit is reached. Nothing
                  was charged. Raise the limit to continue:
                  https://platform.valyu.ai/user/account/billing?tab=credits
                code: credit_limit_reached
                recovery:
                  increase_limit_url: https://platform.valyu.ai/user/account/billing?tab=credits
                transaction_id: tx_a1b2c3d4-e5f6-7890-abcd-ef1234567890
            spend_cap_reached:
              summary: API key budget cap reached
              value:
                success: false
                error: >-
                  This API key has reached its credit cap. Nothing was charged.
                  Raise the key's cap or use an uncapped key:
                  https://platform.valyu.ai/user/account/apikeys
                code: spend_cap_reached
                recovery:
                  increase_cap_url: https://platform.valyu.ai/user/account/apikeys
                transaction_id: tx_a1b2c3d4-e5f6-7890-abcd-ef1234567890
    Forbidden:
      description: >-
        The API key is disabled, revoked or lacks permission for this operation.
        A request over the rate limit returns `429`, not `403`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            forbidden:
              summary: Key disabled or revoked
              value:
                error: Forbidden
                message: Access denied - API key is invalid, disabled, or revoked
            permission:
              summary: Key lacks permission
              value:
                success: false
                error: API key does not have inference permission
    RateLimited:
      description: >-
        Over this endpoint's rate limit for your plan. Nothing is charged. Wait
        `retry_after` seconds (the `Retry-After` header), then retry with
        backoff. See [Rate
        limits](https://docs.valyu.ai/api-reference/overview#rate-limits).


        `message` is a sentence you can relay that names the limit and how to
        raise it. `error` and `code` are both `rate_limited`, and `recovery`
        repeats `retry_after`, `plan`, `limit` and `upgrade_url` (`contact_url`
        on the top plans), which also stay at the top level.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            rate_limited:
              summary: Search rate limit reached
              value:
                error: rate_limited
                code: rate_limited
                message: >-
                  Search rate limit reached: your Pay-as-you-go plan allows 5
                  requests per second. Retry after 2 seconds. Upgrade to
                  Ridiculously Cheap for 10 requests per second:
                  https://platform.valyu.ai/user/account/billing?tab=plan
                retry_after: 2
                plan: Pay-as-you-go
                limit:
                  endpoint: search
                  requests_per_second: 5
                upgrade_url: https://platform.valyu.ai/user/account/billing?tab=plan
                recovery:
                  retry_after: 2
                  upgrade_url: https://platform.valyu.ai/user/account/billing?tab=plan
                  plan: Pay-as-you-go
                  limit:
                    endpoint: search
                    requests_per_second: 5
    InternalServerError:
      description: An unexpected error occurred on the server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            example:
              summary: Internal error
              value:
                success: false
                error: Internal server error. Please try again later.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for authentication. Get yours at
        [platform.valyu.ai](https://platform.valyu.ai).

````

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