<div class="section-label"><span class="num">02</span> API Client</div>
<div class="section-title">Call Grid, MaxFit, and PSR from <em>Python</em>.</div>
The v2 client posts prediction tasks to the hosted API and returns <span class="mono">yhat</span> plus a details dictionary. Inputs are NumPy arrays. Options are the classes in [[Prediction Options|Prediction Options]].
## Task shapes
Each function supports three shapes:
1. **Single task** — one dependent variable, one set of circumstances.
2. **Multi-y** — several dependent variables, one <span class="mono">theta</span>.
3. **Multi-theta** — one dependent variable, several rows of <span class="mono">theta</span>.
> [!warning]
> Multi-y and multi-theta cannot run in the same call. Split them, or loop.
## Functions
| Call | Options class | REST path |
| --- | --- | --- |
| [[predict_grid\|predict_grid]] | <span class="mono">GridOptions</span> | `POST /grid` |
| [[predict_maxfit\|predict_maxfit]] | <span class="mono">MaxFitOptions</span> | `POST /maxfit` |
| [[predict_psr\|predict_psr]] | <span class="mono">PredictionOptions</span> | `POST /psr` |
All three take <span class="mono">y</span>, <span class="mono">X</span>, and <span class="mono">theta</span> as NumPy arrays. The client handles authentication, payload construction, and result retrieval.
For raw HTTP instead, start at [[API/Prediction Engine/Grid|Grid]].
## Related
- [[API/Python API Client/Introduction|Python Client]]
- [[predict_grid|predict_grid]] · [[predict_maxfit|predict_maxfit]] · [[predict_psr|predict_psr]]
- [[Concurrency|Concurrency]]