Completions
The completions endpoint generates text from a single prompt. For conversational use cases, prefer Chat Completions.Edge endpoints accept your
pg_* API key as a bearer token. See Authentication for details. The cURL examples below pin Toronto (yto-01) for concreteness — substitute another region or discover the fastest one via GET https://autorouter.polargrid.ai/v1/route. See API Overview for both patterns.Create Completion
Request Body
Example Request
Response
Streaming
Enable streaming for real-time token generation:Legacy Generate Method
The SDKs also provide agenerate() method for backward compatibility. It wraps chatCompletion() internally:
