Skip to main content
Last updated on
Advanced — 0.0.x primitives

You don't need this page for a normal integration. Use the quickstarts and createMythos() instead. These low-level functions remain exported for custom setups.

require_launch_token

FastAPI dependency factory that verifies a launch token and calls Mythos /consume.

Signature​

python
def require_launch_token(
resolve_listing_ids: Callable[[], Awaitable[list[str]]] | None = None,
) -> Callable[..., Awaitable[MythosSession]]

Parameters​

ParamTypeRequiredDescription
resolve_listing_idsasync () -> list[str]NoDynamic listing IDs from callback

Reads lt from query string.

Usage​

python
from fastapi import Depends
from mythos_sdk import require_launch_token, MythosSession

@app.get("/api/mythos/session")
async def session(session: MythosSession = Depends(require_launch_token())):
return session
warning

require_launch_token is a factory — always use Depends(require_launch_token()) with parentheses.

HTTP exceptions​

StatusDetail
401Invalid launch token
401Token already consumed
503Could not verify session

See also​