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

# Add provider_id to Bearer Login

> Include provider_id on login and register when you use a shared Bearer partner token

**Problem:** You use a shared Bearer `partner_token`, but login or register fails, or Suki cannot tell which provider is active.

**Solution:** Send `provider_id` on every [Login](/api-reference/authentication/login) and [Register](/api-reference/authentication/register). Use `suki_token` as `sdp_suki_token`, and send the same id as `sdp_provider_id` on Ambient API calls.

<Note>
  This cookbook assumes Suki configured you as a Bearer partner, and that you already have your Partner ID, shared Partner Token, and agreed `provider_id` format.
</Note>

### Login

<Tabs>
  <Tab title="CURL">
    ```bash theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
    curl -X POST https://sdp.suki.ai/api/v1/auth/login \
      -H "Content-Type: application/json" \
      -d '{
        "partner_id": "your-partner-id",
        "partner_token": "your-shared-partner-token",
        "provider_id": "provider-123"
      }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
    import requests

    response = requests.post(
        "https://sdp.suki.ai/api/v1/auth/login",
        headers={"Content-Type": "application/json"},
        json={
            "partner_id": partner_id,
            "partner_token": partner_token,
            "provider_id": "provider-123",
        },
    )
    response.raise_for_status()
    suki_token = response.json()["suki_token"]
    # Use as sdp_suki_token; send provider_id as sdp_provider_id on Ambient API calls.
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
    const response = await fetch("https://sdp.suki.ai/api/v1/auth/login", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        partner_id: partnerId,
        partner_token: partnerToken,
        provider_id: "provider-123",
      }),
    });

    if (!response.ok) {
      throw new Error(`Login failed: ${response.status}`);
    }

    const { suki_token: sukiToken } = await response.json();
    // Use as sdp_suki_token; send provider_id as sdp_provider_id on Ambient API calls.
    ```
  </Tab>
</Tabs>

### Register (once)

<Tabs>
  <Tab title="CURL">
    ```bash theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
    curl -X POST https://sdp.suki.ai/api/v1/auth/register \
      -H "Content-Type: application/json" \
      -d '{
        "partner_id": "your-partner-id",
        "partner_token": "your-shared-partner-token",
        "provider_id": "provider-123",
        "provider_name": "Dr. Jane Smith",
        "provider_org_id": "org-123"
      }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
    import requests

    response = requests.post(
        "https://sdp.suki.ai/api/v1/auth/register",
        headers={"Content-Type": "application/json"},
        json={
            "partner_id": partner_id,
            "partner_token": partner_token,
            "provider_id": "provider-123",
            "provider_name": "Dr. Jane Smith",
            "provider_org_id": "org-123",
        },
    )
    # New link: 201. Already linked: 409. Both are success for this flow.
    if response.status_code not in (201, 409):
        response.raise_for_status()
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
    const response = await fetch("https://sdp.suki.ai/api/v1/auth/register", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        partner_id: partnerId,
        partner_token: partnerToken,
        provider_id: "provider-123",
        provider_name: "Dr. Jane Smith",
        provider_org_id: "org-123",
      }),
    });

    // New link: 201. Already linked: 409. Both are success for this flow.
    if (response.status !== 201 && response.status !== 409) {
      throw new Error(`Register failed: ${response.status}`);
    }
    ```
  </Tab>
</Tabs>

## Common mistakes

* For Bearer partners, `provider_id` is required on login and register.
* Protect the shared `partner_token`. Send `sdp_provider_id` on Ambient calls after login.

## Other cookbooks

<div className="cookbook-hub-wrap">
  <div className="hp-io-method-grid tut-hub-card-grid" data-cookbook-related-grid>
    <a className="hp-io-method-card tut-hub-method-card" href="/documentation/cookbooks/pass-emr-encounter-id">
      <div className="tut-hub-card-media" aria-hidden="true" />

      <div className="hp-io-method-card-body">
        <div className="tut-hub-card-badges">
          <span className="hp-wn-badge hp-wn-badge-new">Ambient</span>
          <span className="hp-wn-badge cookbook-hub-badge-surface cookbook-hub-badge-surface--api">API</span>
        </div>

        <h3 className="hp-io-method-card-title">Share One Note Across Products</h3>

        <p className="hp-io-method-card-desc cookbook-hub-card-desc">
          Create session with emr\_encounter\_id.
        </p>

        <div className="hp-io-method-card-meta tut-hub-card-foot" aria-label="5 min">
          <div className="tut-hub-card-foot-meta">
            <span className="hp-io-method-card-meta-time">5 min</span>
          </div>
        </div>
      </div>
    </a>

    <a className="hp-io-method-card tut-hub-method-card" href="/documentation/cookbooks/dictation-onsubmit-chart-field">
      <div className="tut-hub-card-media tut-hub-card-media--blue" aria-hidden="true" />

      <div className="hp-io-method-card-body">
        <div className="tut-hub-card-badges">
          <span className="hp-wn-badge hp-wn-badge-new">Dictation</span>
          <span className="hp-wn-badge cookbook-hub-badge-surface cookbook-hub-badge-surface--sdk">SDK</span>
        </div>

        <h3 className="hp-io-method-card-title">Write Dictation Text to an EHR Field</h3>

        <p className="hp-io-method-card-desc cookbook-hub-card-desc">
          Write Dictation text with onSubmit.
        </p>

        <div className="hp-io-method-card-meta tut-hub-card-foot" aria-label="5 min">
          <div className="tut-hub-card-foot-meta">
            <span className="hp-io-method-card-meta-time">5 min</span>
          </div>
        </div>
      </div>
    </a>
  </div>
</div>
