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

# Quickstart

> Go from an empty workspace to your first search result in a few minutes: create a source, add a handful of records, and search them.

This is the fastest path from nothing to a working search. You'll create a source, push a few records straight over HTTP, and search them — no files, no infrastructure. When you're ready for real data, [Add your data](/guides/ingest-a-dataset) covers file uploads and your own S3 bucket.

## Prerequisites

* A **tenant API key** (`spltk.v1.…`) and your tenant ID, both from the [console](https://app.withsplendor.com): open the **API Keys** panel and create a key. The key is shown once.
* An **admin** role in the tenant — minting a key, and creating a source, both require admin. (Minting the key is the one step that must be done by a signed-in admin in the browser; see [Authentication](/authentication) for why, and for the platform-key model if you run many tenants.)

Creating the key in the console is the only step here that needs a browser — every call below is plain HTTP you can run yourself or hand to an agent.

<Tip>
  Export your credentials once so the examples run as-is:

  ```bash theme={null}
  export SPLENDOR_TOKEN="spltk.v1...."   # your tenant API key
  export SPLENDOR_TENANT_ID="your-tenant-id"
  ```
</Tip>

## Steps

<Steps>
  <Step title="Create a source">
    A source is where data lands and which dataset it feeds. Create one hosted source for this quickstart.

    ```bash theme={null}
    curl https://api.withsplendor.com/v1/admin/hosted-sources \
      -H "Authorization: Bearer $SPLENDOR_TOKEN" \
      -H "X-Splendor-Tenant-Id: $SPLENDOR_TENANT_ID" \
      -H "Content-Type: application/json" \
      -d '{
        "source_key": "quickstart",
        "name": "Quickstart",
        "dataset_id": "quickstart",
        "source_type": "hosted"
      }'
    ```

    Note the numeric `source_id` in the response — you need it for the next step.
  </Step>

  <Step title="Mint an ingest token">
    An ingest token authorizes pushing data to this one source. It carries the source and tenant itself, so ingest calls need no tenant header. The plaintext token is shown once.

    ```bash theme={null}
    curl -X POST https://api.withsplendor.com/v1/admin/sources/$SOURCE_ID/ingest-token \
      -H "Authorization: Bearer $SPLENDOR_TOKEN" \
      -H "X-Splendor-Tenant-Id: $SPLENDOR_TENANT_ID"
    ```

    Export it for the push step:

    ```bash theme={null}
    export SPLENDOR_INGEST_TOKEN="sit_live_..."
    ```
  </Step>

  <Step title="Push a few records">
    Send a small batch of records as a JSON array. Splendor accepts it and indexes it asynchronously, returning `202 Accepted`.

    ```bash theme={null}
    curl https://api.withsplendor.com/v1/ingest/sources/quickstart/logs \
      -H "Authorization: Bearer $SPLENDOR_INGEST_TOKEN" \
      -H "Content-Type: application/json" \
      -d '[
        {"level": "error", "message": "connection timeout after 30s", "service": "checkout"},
        {"level": "info",  "message": "payment captured", "service": "checkout"},
        {"level": "warn",  "message": "retrying upstream call", "service": "search"}
      ]'
    ```
  </Step>

  <Step title="Wait until it's searchable">
    Indexing takes a moment. Poll the dataset's readiness until text search is ready.

    ```bash theme={null}
    curl https://api.withsplendor.com/v1/datasets/quickstart/readiness \
      -H "Authorization: Bearer $SPLENDOR_TOKEN" \
      -H "X-Splendor-Tenant-Id: $SPLENDOR_TENANT_ID"
    ```
  </Step>

  <Step title="Search it">
    Query the dataset. The body selects the datasets, the query text, and how many results to return.

    <CodeGroup>
      ```bash curl theme={null}
      curl https://api.withsplendor.com/v1/search \
        -H "Authorization: Bearer $SPLENDOR_TOKEN" \
        -H "X-Splendor-Tenant-Id: $SPLENDOR_TENANT_ID" \
        -H "Content-Type: application/json" \
        -d '{"text": "timeout", "datasets": ["quickstart"], "limit": 10}'
      ```

      ```python Python theme={null}
      import os, httpx

      client = httpx.Client(
          base_url="https://api.withsplendor.com",
          headers={
              "Authorization": f"Bearer {os.environ['SPLENDOR_TOKEN']}",
              "X-Splendor-Tenant-Id": os.environ["SPLENDOR_TENANT_ID"],
          },
      )
      envelope = client.post(
          "/v1/search",
          json={"text": "timeout", "datasets": ["quickstart"], "limit": 10},
      ).json()
      for result in envelope["results"]:
          print(result["score"], result["body"][:120])
      ```
    </CodeGroup>

    You get back the **response envelope** — the same shape for every kind of search:

    ```json theme={null}
    {
      "search_id": "srch_8f2c...",
      "mode": "text",
      "returned": 1,
      "total": { "value": 1, "relation": "eq" },
      "has_more": false,
      "results": [
        {
          "id": "rec_01H...",
          "body": "connection timeout after 30s",
          "snippets": ["connection <em>timeout</em> after 30s"],
          "score": 12.4,
          "provenance": { "dataset_id": "quickstart", "source": "quickstart", "line": 1 }
        }
      ]
    }
    ```

    Keep the `search_id` — it's a [handle](/concepts/handles-and-cursors) you can use to page, export, or save the query as a view, without re-sending it.
  </Step>
</Steps>

<Check>
  If `results` is non-empty and you have a `search_id`, you're working end to end — from an empty workspace to a search result.
</Check>

## What to do next

<Columns cols={2}>
  <Card title="See what you can build" icon="lightbulb" href="/recipes">
    Real patterns: search by meaning, search by image, one search backend per customer.
  </Card>

  <Card title="Add your real data" icon="upload" href="/guides/ingest-a-dataset">
    Upload files, stream events, or read from your own S3 bucket.
  </Card>

  <Card title="Search model" icon="layer-group" href="/concepts/search-model">
    Text, SQL, and semantic search — and when to use each.
  </Card>

  <Card title="Handles & cursors" icon="link" href="/concepts/handles-and-cursors">
    Page through results, export, and re-run queries from a handle.
  </Card>
</Columns>
