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

# Run your first ingest job

> Install sphinx_learn, submit your first documents with .fit, and follow the ingest job in Sphinx.

Use this quickstart to submit a document to your Sphinx knowledge base with `.fit` and open the resulting ingest job. The example supplies its own text, so you do not need a local document to get started.

## Prerequisites

* Python **3.13 or later**.
* An existing Sphinx project and its project ID.
* An API key provided to you by Sphinx.
* Network access to the Sphinx API and the upload URLs it provides.

Sphinx will provide your API key. Keep the key in an environment variable rather than embedding it in your script.

## 1. Install the library

The package name is `sphinx_learn`. Once the package is published, install it with:

```bash theme={null}
python -m pip install sphinx_learn
```

## 2. Submit an ingest job

Set `SPHINX_API_KEY` and `SPHINX_PROJECT_ID` in your environment, then run:

```python theme={null}
import os

from sphinx_ai import File, createKnowledgeBaseClient

knowledge_base = createKnowledgeBaseClient(
    api_key=os.environ["SPHINX_API_KEY"],
    project_id=os.environ["SPHINX_PROJECT_ID"],
)

ingestion = knowledge_base.fit(
    prompt=(
        "Learn a knowledge graph that helps us understand how metrics are defined at our company."
    ),
    docs=[
        File(
            path="metrics/active-customers.txt",
            content=(
                "An active customer is an account with at least one paid order "
                "in the last 30 days. Exclude test accounts and canceled orders."
            ).encode("utf-8"),
        ),
    ],
)

print(ingestion.job_url())
```

## 3. Follow the job in Sphinx

`File(...)` validates each document's path and content immediately. `.fit(...)` checks the prompt and batch limits before uploading. See [input constraints](/python-sdk/fit#input-constraints) when preparing your own documents.

The script prints a URL with this structure:

```text theme={null}
https://app.sphinx.ai/knowledge-base/projects/<project_id>/ingest/<job_id>
```

Open the URL to check the job's progress and results. The prompt tells the ingest job what you want to do with the documents; it is not a guarantee of a particular output.

<Note>
  `.fit` returns after uploading the documents and submitting the job. Ingestion continues separately. Check the job in Sphinx to confirm it completed successfully and review the results.
</Note>

## Next steps

See [Using .fit library](/python-sdk/fit) for the API reference, supported formats, exact input limits, and failure handling.
