Generate an example from open-source references
Generate a code example for a programming task using open-source references. The response contains Markdown with source references, license attribution, and a link to the saved example.
Use this endpoint when you want an example tailored to your task. To find existing documentation or code instead, use POST /v1/searches. You can rate a saved example with POST /v1/feedback.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional client attribution: trimmed printable ASCII, at most 80 bytes. Invalid optional values are dropped.
Optional client-version attribution: trimmed printable ASCII, at most 80 bytes. Invalid optional values are dropped.
Optional agent attribution: trimmed printable ASCII, at most 160 bytes. Invalid optional values are dropped.
Optional session attribution: trimmed printable ASCII, at most 128 bytes. Invalid optional values are dropped; no session is created.
Body
Generate one full markdown result; unknown or duplicate JSON keys are rejected.
Programming task to demonstrate, such as reading a JSON file in Rust. Must be nonblank and at most 8192 Unicode scalar values; text is preserved exactly.
1 - 8192"Read a JSON file in Rust"
Optional nonblank language name or alias; inferred upstream when omitted/null.
1"rust"
License policy for source examples: strict (default) applies the strict filter,
custom uses your account policy, and yolo disables license filtering.
strict, yolo, custom Response
Full markdown with saved solution identity and source evidence completeness.
Unaltered markdown with its saved solution and source-evidence completeness.
Full generated Markdown, including source references, license attribution and the saved-solution link.
Whether the source search was complete or degraded. A degraded search means some source information was unavailable; generation still succeeded.
complete, degraded Identifier of the saved example linked in the Markdown footer.
Use this as solution_id with POST /v1/feedback to rate the example.