Spotted Python SDK

raw JSON →
0.31.1 verified Sat May 09 auth: no python

The official Python library for the Spotted API, providing a typed interface for programmatic access. Current version 0.31.1, with frequent releases reflecting active development.

pip install spotted
error ImportError: cannot import name 'SpottedAPI' from 'spotted'
cause The client class was renamed from SpottedAPI to Spotted.
fix
Use from spotted import Spotted.
error Error: file data must be sent as a single parameter
cause Multiple file arguments were incorrectly passed as separate parameters instead of a single list.
fix
Pass files as files=[('file', open('photo.jpg', 'rb'))] or upgrade to >=0.30.2.
error TypeError: 'by_alias' is an invalid keyword argument
cause Pydantic version mismatch; a bug in 0.29.1 passed `by_alias` without checking if set.
fix
Upgrade to >=0.29.2 or ensure compatible pydantic version.
breaking The client class was renamed from `SpottedAPI` to `Spotted` in an early version. Using the old name will raise an ImportError.
fix Use `from spotted import Spotted` instead of `from spotted import SpottedAPI`.
gotcha File uploads require multi-part form data; ensure file paths are sent as a single parameter, not spread across multiple values. Bug fixed in 0.30.2.
fix Upgrade to >=0.30.2 or ensure file data is passed as a single tuple/list.
deprecated Setting custom headers via constructor kwargs is deprecated in favor of environment variables. Support added in 0.31.0.
fix Set headers via environment variables (e.g., `MY_HEADER=value`) or use the `default_headers` parameter in the client.

Initialize the client with an API key from environment variable and list available models.

from spotted import Spotted

client = Spotted(api_key=os.environ.get('SPOTTED_API_KEY', ''))

models = client.models.list()
print(models)