Packages@downcity/cityCity
Common Patterns and Errors
Common City combinations in real cities, and how to reason about token, model, and service-related errors.
The three most common combinations
Pure AI city
@downcity/city- City exports from
@downcity/city
AI city with minimal auth
@downcity/city- City exports from
@downcity/city @downcity/services
AI city with usage and payment
@downcity/city- City exports from
@downcity/city @downcity/services
Most common 401 / 403 causes
user_tokenwas not sent- the token expired
- the
city_iddoes not match the token - the city has been paused
Most common 404 causes
- the target service was never mounted into City
- the Action path is wrong
- you assumed a service was enabled, but forgot
base.use(service())
Most common 422 causes
- the AI call references a model that does not exist
- the current model does not support the requested modality
- the custom service input does not match what the Action expects
A simple debug order
- confirm whether the call is AI service, custom service, or service
- confirm whether the current phase is guest access or logged-in user access
- then compare
city_id,user_token, service id, action id, and model id