Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Stedi

Scalekit connector
Open markdown

The Stedi connector lets your AI agent act in each user's Stedi account. Each user connects their own Stedi API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 17 tools.

Tools
17
What they doRead · write · destructive
16 · 1 · 016 read1 write0 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Stedi connection

    In AgentKit > Connections, create a Stedi connection. The name you give it is the connection_name your code passes. See Configure connections.

    Console steps with screenshots

    Stedi connections use a Stedi API key. One key works for every Stedi API the tools call: payers, eligibility, claim status, claims and reports.

    1. Create a Stedi API key

      In the Stedi portal, open API keys and create a key in Test or Production mode.

      • Test keys return mock responses: for eligibility checks, send only Stedi’s mock request payloads, never real patient data; for claims, use payer ID STEDI.
      • Production keys reach real payers. Real-time claim status (stedi_check_claim_status) accepts only production keys, for claims a payer has accepted.
    2. Create the connection

      In the Scalekit dashboard, go to AgentKit > Connections > Create Connection, find Stedi and click Create. The connection name is the connection_name your code passes.

    3. Add a connected account

      To test, open the connection, click the Connected Accounts tab > Add Account, enter the user’s identifier, such as user_123, and paste the key as API Key. Paste the key only, without a Bearer prefix.

      In production, each user opens the authorization link and enters the key there.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'stedi'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Stedi:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'stedi_list_claims',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Stedi credentials there. If your app already has a user's credentials, add the account from your backend instead, as the console steps above show. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • stedi_check_claim_statusSend a real-time 276/277 claim status request to a payer through Stedi for a claim the payer has already accepted.Read-only

    Check Claim Status

    Send a real-time 276/277 claim status request to a payer through Stedi for a claim the payer has already accepted. Returns the payer's 277 response as JSON: a claims array where each matching claim has claimStatus (status category and codes, payer claim number, charge and paid amounts, dates) and serviceDetails, plus payer, providers, subscriber, errors and the raw X12. Use when a 277CA or 835 ERA has not arrived in the expected time. Use stedi_list_claims or stedi_get_claim_timeline to see what Stedi has already received. Works with production API keys only.

    Inputs

    providersarrayrequired
    The billing provider (exactly one) and optionally service providers on the claim. Each entry has providerType (BillingProvider or ServiceProvider), npi, and organizationName or firstName and lastName; tin is sometimes required by the payer. Example: [{"providerType": "BillingProvider", "npi": "1999999984", "organizationName": "Example Clinic"}].
    subscriberobjectrequired
    The subscriber on the claim: memberId, firstName and lastName are required; add dateOfBirth (YYYYMMDD) and gender (M or F) when the subscriber is the patient. Example: {"memberId": "TEST12345", "firstName": "Test", "lastName": "Patient", "dateOfBirth": "19800101"}.
    trading_partner_service_idstringrequired
    The payer ID the claim was sent to (primary payer ID, Stedi payer ID or alias).
    dependentobject
    The patient, when the patient is a dependent on the subscriber's policy: firstName, lastName, dateOfBirth (YYYYMMDD) and gender (M or F). Example: {"firstName": "Test", "lastName": "Child", "dateOfBirth": "20150101"}.
    encounterobject
    Identifies the claim. Stedi recommends a date-of-service range (beginningDateOfService and endDateOfService, YYYYMMDD); you can also pass the payer's claim number (tradingPartnerClaimNumber), patientAccountNumber or submittedAmount. Sending too much detail can hide matches. Example: {"beginningDateOfService": "20260101", "endDateOfService": "20260107"}.
    trading_partner_namestring
    The payer's name, such as Cigna or Aetna. Optional.
  • stedi_check_coordination_of_benefitsCheck whether a patient has other active health coverage and which payer is primary, using Stedi's coordination of benefits (COB) database.Read-only

    Check Coordination of Benefits

    Check whether a patient has other active health coverage and which payer is primary, using Stedi's coordination of benefits (COB) database. Returns coordinationOfBenefits (whether COB applies and the payer responsibility sequence, such as primary or secondary), benefitsInformation for the other active plans found, plan dates, and payer, subscriber and errors details. Use when a patient may have more than one plan, before billing. Use stedi_check_eligibility for benefits under one known plan; the payer must support COB checks (filter stedi_search_payers by coordination_of_benefits).

    Inputs

    encounterobjectrequired
    The date of service (YYYY-MM-DD) and the service type code; use 30 (health benefit plan coverage). Example: {"dateOfService": "2026-01-15", "serviceTypeCode": "30"}.
    providerobjectrequired
    The provider requesting the check: organizationName (or firstName and lastName for an individual) and npi. Example: {"organizationName": "Example Clinic", "npi": "1999999984"}.
    subscriberobjectrequired
    The primary policyholder, or a dependent with their own member ID: memberId, firstName, lastName and dateOfBirth (YYYY-MM-DD). Example: {"memberId": "TEST12345", "firstName": "Test", "lastName": "Patient", "dateOfBirth": "1980-01-01"}.
    trading_partner_service_idstringrequired
    The payer ID of a Stedi-supported COB payer the patient is known to have coverage with.
    dependentobject
    A dependent listed on the subscriber's policy who has no member ID of their own: firstName, lastName and dateOfBirth. Example: {"firstName": "Test", "lastName": "Child", "dateOfBirth": "2015-01-01"}.
  • stedi_check_eligibilityRun a real-time 270/271 insurance eligibility and benefits check with a payer through Stedi.Read-only

    Check Eligibility

    Run a real-time 270/271 insurance eligibility and benefits check with a payer through Stedi. Returns the payer's 271 response as JSON: payer, provider and subscriber details, plans with their benefits (coverage status, copays, coinsurance, deductibles), errors and warnings, plus the raw X12. Use before a visit to confirm active coverage and patient responsibility. Use stedi_check_coordination_of_benefits to find other coverage; use stedi_search_payers first to get the payer ID.

    Inputs

    payer_idstringrequired
    The payer ID to send the check to: the primary payer ID, Stedi payer ID or any payer ID alias from the Payer Network. Test API keys only accept Stedi's mock payer requests.
    providerobjectrequired
    The provider requesting the check. It needs a name, given as an organization name or a person's first and last name, and usually the provider's 10-digit NPI. Tax ID and other identifiers are only needed when a payer asks for them. Example: {"name": {"organization": "Example Clinic"}, "npi": "1999999984"}.
    subscriberobjectrequired
    The primary policyholder, or a dependent who has their own member ID. Send the member ID, the name as a person (firstName, lastName) and the date of birth (YYYY-MM-DD); payers match on these. Gender (MALE or FEMALE) and address are optional. Example: {"memberId": "TEST12345", "name": {"person": {"firstName": "Test", "lastName": "Patient"}}, "dateOfBirth": "1980-01-01"}.
    dependentobject
    A dependent to check, only when the patient is listed under the subscriber's policy and has no member ID of their own. One dependent per check. Give the name (person firstName and lastName), date of birth and relationship to the subscriber (SPOUSE, CHILD or OTHER_ADULT). Example: {"name": {"person": {"firstName": "Test", "lastName": "Child"}}, "dateOfBirth": "2015-01-01", "relationToSubscriber": "CHILD"}.
    eligibility_search_idstring
    Identifier that groups several eligibility checks for the same patient into one eligibility search record in the Stedi portal.
    encounterobject
    What benefits to ask about. List services as code system plus value: STC service type codes (for example 30 for general health plan coverage), CPT or HCPCS codes. Optionally add a service date or date range (dates.service); without one the payer uses today. Example: {"services": [{"system": "STC", "value": "30"}]}.
    external_patient_idstring
    Your own unique identifier for the patient. Stedi uses it to correlate past eligibility checks for the same person; recommended on every request.
    payer_namestring
    The payer's name, such as Cigna or Aetna. Optional and informational.
  • stedi_get_277ca_reportRetrieve a processed 277CA claim acknowledgment from Stedi as JSON.Read-only

    Get 277CA Report

    Retrieve a processed 277CA claim acknowledgment from Stedi as JSON. Returns a transactions array; each 277CA lists payers with their providers and claims, and each claim's status (accepted or rejected) with status category codes and rejection reasons. Use to see whether a payer accepted or rejected submitted claims. Find the transaction ID with stedi_list_transactions (transaction_set_id 277) or stedi_poll_transactions.

    Inputs

    transaction_idstringrequired
    Stedi's transaction ID of the processed 277 claim acknowledgment transaction. Find it with List Transactions (filter by transaction set 277), Poll Transactions or a claim's timeline.
  • stedi_get_claimRetrieve one claim record with a summary of its latest submission.Read-only

    Get Claim

    Retrieve one claim record with a summary of its latest submission. Returns the claim's id, status, statusReportedBy, patientControlNumber, patientName, stediPayerId, submittedAt, total charge and paid amounts, datesOfService and type. Use to check a claim's current status. Use stedi_get_claim_timeline for every submission, acknowledgment and payment, and stedi_list_claims to find the claim ID.

    Inputs

    claim_idstringrequired
    Stedi's claim ID: the claimId from Submit Professional Claim or the id of an item from List Claims.
  • stedi_get_claim_timelineList the timeline of one claim: its submissions, 277CA acknowledgments and ERA payment information, newest first.Read-only

    Get Claim Timeline

    List the timeline of one claim: its submissions, 277CA acknowledgments and ERA payment information, newest first. Returns items (timeline entries for submissions, 277CA acknowledgments and ERA payments) and nextPageToken. Use to follow a claim's full lifecycle or find the transaction ID of its 277CA or ERA. Use stedi_get_claim for the current status only.

    Inputs

    claim_idstringrequired
    Stedi's claim ID: the claimId from Submit Professional Claim or the id of an item from List Claims.
    page_sizeinteger
    Maximum number of timeline entries per page. Stedi defaults to 100.
    page_tokenstring
    Opaque token from the nextPageToken field of a previous response, used to fetch the next page. Omit for the first page.
  • stedi_get_era_reportRetrieve a processed 835 Electronic Remittance Advice (ERA) from Stedi as JSON.Read-only

    Get 835 ERA Report

    Retrieve a processed 835 Electronic Remittance Advice (ERA) from Stedi as JSON. Returns a transactions array; each ERA has payer and payee, financialInformation (payment amount, method and date), paymentAndRemitReassociationDetails (check or EFT trace number), detailInfo with per-claim payment and adjustment details, and providerAdjustments. Use to reconcile what a payer paid on claims. Find the transaction ID with stedi_list_transactions (transaction_set_id 835) or stedi_poll_transactions.

    Inputs

    transaction_idstringrequired
    Stedi's transaction ID of the processed 835 ERA transaction. Find it with List Transactions (filter by transaction set 835), Poll Transactions or a claim's timeline.
  • stedi_get_payerRetrieve one payer record from Stedi's Payer Network by its Stedi payer ID.Read-only

    Get Payer

    Retrieve one payer record from Stedi's Payer Network by its Stedi payer ID. Returns a payer object with stediId, displayName, primaryPayerId, aliases, names, coverage types, operating states, programs, supported transaction types and enrollment requirements. Use when you already have the Stedi payer ID. Use stedi_search_payers to look a payer up by name, primary payer ID or alias; this endpoint does not accept those.

    Inputs

    stedi_idstringrequired
    The Stedi payer ID, a permanent identifier Stedi assigns to each payer (the stediId field in search results). The primary payer ID and aliases are not accepted here.