Skip to main content

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

Generate a completion for the given prompt.

Request Body

Example Request

Response

Streaming

Enable streaming for real-time token generation:

Legacy Generate Method

The SDKs also provide a generate() method for backward compatibility. It wraps chatCompletion() internally: