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

# Code Prediction endpoint

> Learn how to make a basic code prediction request

Prediction of codes across many different systems are supported through a single REST endpoint request:

```
POST https://api.$environment.corti.app/v2/tools/coding/
```

Pass your clinical context in the request body and receive a structured list of medical codes ready for review.

<Steps>
  <Step title="Choose one or more coding systems">
    Set `system` to an array of one or more system identifiers. Systems are typically combined by encounter type — for example, `icd10cm-outpatient` + `cpt` for office visits and ED encounters, or `icd10cm-inpatient` + `icd10pcs` for hospital admissions. See [Coding Systems](/coding/coding-systems) for the full list.
  </Step>

  <Step title="Pass your clinical context">
    The `context` field is an array of context objects. Two input types are supported:

    * **Text** — `type: "text"` with the clinical text in `text`. Pass multiple objects to provide multiple context sources.
    * **Document** — `type: "documentId"` with a document ID in `documentId`, referencing a document already stored in Corti.
  </Step>

  <Step title="Read the response">
    `codes` contains the medical entities the model predicts should be coded. `candidates` contains entities that are clinically relevant but not strictly required — optional codes surfaced for human review. `usageInfo.creditsConsumed` reports the credits used for the request, which is reflected in your account billing.
  </Step>
</Steps>

***

## Examples

<Accordion title="A request against a single coding system">
  ```json theme={null}
  {
    "system": ["icd10cm-outpatient"],
    "context": [
      { "type": "text", "text": "Patient presents with acute otitis media of the right ear." }
    ]
  }
  ```
</Accordion>

<Accordion title="A request against multiple coding systems in one request">
  Notice the response includes codes from all requested systems in the same `codes` array, each tagged with its `system` value:

  ```json theme={null}
  {
    "system": ["icd10cm-outpatient", "cpt"],
    "context": [
      { "type": "text", "text": "Patient presents with acute otitis media of the right ear." }
    ]
  }
  ```
</Accordion>

***

## Next Steps

<Columns cols={2}>
  <Card title="Coding Systems" href="/coding/coding-systems" icon="list-check">
    Details on available systems and recommendations of pairings by use case.
  </Card>

  <Card title="Integration Guides" href="/coding/guides-overview" icon="navigation">
    Learn how to combine code prediction with agents and client-side content to build coding workflows.
  </Card>

  <Card title="Codes and candidates" href="/coding/codes-and-candidates" icon="code">
    Learn more about the predict codes response message including two objects, `codes` and `candidates`.
  </Card>

  <Card title="Code filtering" href="/coding/code-filtering" icon="funnel">
    Learn how to restrict codes the model may predict using the `filter` field.
  </Card>
</Columns>

<Note>Please [contact us](mailto:help@corti.ai) if you need help getting started or run into issues with your first request.</Note>
