---
title: "Legacy API Inference Chat"
method: POST
path: "/external/api/inference"
---

# Legacy API Inference Chat

`POST /external/api/inference`

Calls an Inflection model using the legacy chat API.

## Query parameters

- `origin_endpoint` string, nullable

## Request body

- ExternalChatBody
  - `context` ExternalTurn[], required
    - `type` 'AI' | 'Human' | 'Retrieval' | 'Instruction' | 'Metadata' | 'LinkedWebpages' | 'System' | 'Question' | 'Options' | 'Role' | 'Answer' | 'AI (internally)' | 'Tool', required
    - `text` string, required
    - `ts` string, date-time, nullable
    - `tool_calls` ChatCompletionMessageFunctionToolCallParam[], nullable
      - `id` string, required
      - `function` Function, required
        - `arguments` string, required
        - `name` string, required
      - `type` 'function', required
    - `tool_call_id` string, nullable
  - `config` string
  - `metadata` ExternalMetadata
    - `user_timezone` string, nullable
    - `user_firstname` string, nullable
    - `user_country` string, nullable
    - `user_region` string, nullable
    - `user_city` string, nullable
  - `temperature` number, nullable
  - `stop_tokens` string[], nullable
  - `max_tokens` integer, nullable
  - `top_p` number, nullable
  - `web_search` boolean
  - `tools` ChatCompletionToolsParam[], nullable
    - `type` 'function'
    - `function` FunctionDefinition, required
      - `name` string, required
      - `description` string, nullable
      - `parameters` object, nullable
  - `server_target` string, nullable
  - `response_format` union
    - ResponseFormat
      - `type` 'text' | 'json_object' | 'json_schema', required
      - `json_schema` JsonSchemaResponseFormat
        - `name` string, required
        - `description` string, nullable
        - `schema` object, nullable
        - `strict` boolean, nullable
    - StructuralTagResponseFormat
      - `type` 'structural_tag', required
      - `structures` StructuralTag[], required
        - `begin` string, required
        - `schema` object, nullable
        - `end` string, required
      - `triggers` string[], required
  - `schemas` string[], nullable

## Response `200`

Returns the chat response with text and optional tool calls

- ExternalChatResponse
  - `created` number, required
  - `text` string, required
  - `tool_calls` ToolCall[], nullable
    - `id` string
    - `type` 'function'
    - `function` FunctionCallOutput, required
      - `name` string, required
      - `arguments` string, required
  - `reasoning_content` string, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/inflection/apis/inflection-inference-api.md) · [All operations](https://skmtc.dev/inflection/apis/inflection-inference-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/inflection/inflection-inference-api/revisions/33cb516e2543/schema)
