Skip to content

Examples

These examples show complete programs you can copy, compile, and adapt. They all live in the repository’s examples/ directory.

Most examples use OpenAI. Set OPENAI_API_KEY before running them, or follow the provider-specific instructions on the smoke-test pages.

Run an example from the repository root:

Terminal window
OPENAI_API_KEY=... nim c -r examples/generate_text.nim

The examples cover:

The PDF example uses the repository’s bundled examples/example.pdf file. The smoke tests make live provider requests and need their provider credentials.