Skip to main content
Completing this quickstart will get you a working code prediction response from the Corti Medical Coding API. You can then explore the full API and use cases from there.

Prerequisites

  • A Corti API Console account — sign up at the Corti API Console to get started.
  • An API client — your tenant name, clientId, and clientSecret are all found in your API client configuration. See Creating API clients to set one up.
1

Send a prediction request

POST a clinical note to the code prediction endpoint. The system field determines which classification is applied.
Your environment (eu or us) is set in your API client — see Creating API clients.
ParameterTypeRequiredDescription
systemstring[]YesOne or more coding systems. Up to 4 per request. See Coding Systems for all options and recommended pairings.
contextobject[]YesThe clinical input to code. Each item is a text string or a documentId referencing a document stored in Corti.
filterobjectNoRestrict predictions to specific codes or categories. See Code Prediction for details.
// npm install @corti/sdk
import { CortiClient, CortiEnvironment } from "@corti/sdk";

// Use CortiEnvironment.Eu or CortiEnvironment.Us — see Creating API clients
const client = new CortiClient({
    environment: CortiEnvironment.Eu,
    clientId: CLIENT_ID,
    clientSecret: CLIENT_SECRET,
    tenantName: TENANT_NAME,
});

const result = await client.codes.predict({
    system: ["icd10cm-outpatient"],
    context: [
        {
            type: "text",
            text: "58-year-old male presents for routine diabetes management. HbA1c is 7.2%. Patient reports occasional mild hypoglycemia. Currently on metformin 1000mg twice daily. Also notes bilateral knee pain consistent with osteoarthritis.",
        },
    ],
});
The SDK handles OAuth 2.0 token acquisition and refresh automatically using your clientId and clientSecret — no need to manage bearer tokens manually.
2

Read the response

A successful response returns three top-level fields:
  • codes — the model’s high-confidence predictions. Each entry includes the code, a human-readable display, evidences (the exact passages from the note that support the prediction, with contextIndex, text, and start/end character offsets), and alternatives (other codes the model considered for the same finding).
  • candidates — lower-confidence codes worth reviewing. Intended for coder review rather than automatic assignment.
  • usageInfo — credits consumed for this request.
{
  "codes": [
    {
      "system": "icd10cm-outpatient",
      "code": "E11649",
      "display": "Type 2 diabetes mellitus with hypoglycemia without coma",
      "evidences": [
        {
          "contextIndex": 0,
          "text": "occasional mild hypoglycemia",
          "start": 90,
          "end": 118
        }
      ],
      "alternatives": [
        {
          "code": "E1165",
          "display": "Type 2 diabetes mellitus with hyperglycemia"
        }
      ]
    },
    {
      "system": "icd10cm-outpatient",
      "code": "M1711",
      "display": "Primary osteoarthritis, right knee",
      "evidences": [
        {
          "contextIndex": 0,
          "text": "bilateral knee pain consistent with osteoarthritis",
          "start": 174,
          "end": 224
        }
      ]
    }
  ],
  "candidates": [
    {
      "system": "icd10cm-outpatient",
      "code": "Z794",
      "display": "Long-term (current) use of insulin"
    }
  ],
  "usageInfo": {
    "creditsConsumed": 1.5
  }
}
3

Combine coding systems

Most US encounters require more than one coding system. Pass multiple values in system — for example, pairing ICD-10-CM with CPT for an outpatient visit. The response includes codes from all requested systems in the same codes array, each tagged with its system value.
const result = await client.codes.predict({
    system: ["icd10cm-outpatient", "cpt"],
    context: [
        {
            type: "text",
            text: "58-year-old male presents for routine diabetes management. HbA1c is 7.2%. Patient reports occasional mild hypoglycemia. Currently on metformin 1000mg twice daily. Also notes bilateral knee pain consistent with osteoarthritis.",
        },
    ],
});
See Coding Systems for recommended pairings by encounter type.

Next steps

Code Prediction

Learn about the endpoint, supported features, and coding system options.

How it works

Understand the request schema, response fields, evidence spans, and filtering options.

Use cases

Encounter coding, CDI review, HCC capture, and revenue cycle workflows.
Please contact us if you need help getting started or run into issues with your first request.