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:
2. Submit an ingest job
Set SPHINX_API_KEY and SPHINX_PROJECT_ID in your environment, then run:
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 when preparing your own documents.
The script prints a URL with this structure:
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.
.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.
Next steps
See Using .fit library for the API reference, supported formats, exact input limits, and failure handling.