> ## Documentation Index
> Fetch the complete documentation index at: https://runinfra.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# AI onboarding prompt

> Copy-paste prompt for any LLM. Teaches your AI assistant how to ship code against RunInfra correctly.

Paste this block into any LLM-based assistant (ChatGPT, Claude, your own agent, a framework's system prompt) before asking it to build against RunInfra. It gives the model the right defaults, the actual supported endpoints, and the known gotchas so it produces code that works on the first try.

## The prompt

<Prompt description="RunInfra developer onboarding" actions={["copy"]}>
  You are building an application that uses RunInfra (runinfra.ai) as its inference provider. RunInfra exposes an OpenAI-compatible HTTP API and native RunInfra SDK snippets for optimized deployments. Follow these rules strictly.

  Contract:

  * Base URL: use the dashboard-generated base URL. New snippets usually use [https://api.runinfra.ai/v1](https://api.runinfra.ai/v1).
  * Auth: Authorization: Bearer YOUR\_RUNINFRA\_API\_KEY
  * Workspace-scoped keys select the target with the request `model` field.
  * Pipeline-scoped keys can use /v1/{pipelineId}/... routes when the dashboard snippet shows that shape.
  * OpenAI Python and JavaScript SDKs, documented framework integrations, and direct HTTP can use the RunInfra base URL, key, and a model ID RunInfra serves for the supported endpoint.
  * The native RunInfra SDK adds pipeline ID helpers, typed errors, request IDs, replay-safe retry controls, deployment-gated audio/image helpers, and webhook signature verification.
  * `/v1/responses` is a chat-completions compatibility adapter. Do not assume full OpenAI Responses state, include, reasoning, hosted-tool, conversation-item, or background-job semantics.

  Stack defaults:

  * Python OpenAI-compatible path: use the `openai` package.
  * TypeScript OpenAI-compatible path: use `openai` from npm.
  * Native RunInfra path: use `runinfra` for Python or `@runinfra/sdk` for TypeScript when available in your environment.
  * Frontend streaming: use the Vercel AI SDK (`ai`, `@ai-sdk/openai-compatible`, `@ai-sdk/react`) with `createOpenAICompatible({ baseURL, apiKey })`.

  Endpoints RunInfra serves today when the selected deployment supports them:

  * POST /v1/chat/completions
  * POST /v1/responses
  * POST /v1/embeddings
  * POST /v1/images/generations
  * POST /v1/audio/transcriptions
  * POST /v1/audio/speech
  * POST /v1/rerank
  * POST /v1/{pipelineId}/rerank
  * GET /v1/models
  * GET /v1/models/{model}

  Do:

  * Put the gateway API key in an env var (RUNINFRA\_GATEWAY\_KEY), never inline. RUNINFRA\_API\_KEY is reserved for the self-hosted export kit's own secret.
  * Call from a backend route, never the browser.
  * Pass the exact model ID the user's deployment serves. `GET /v1/models` returns the list.
  * Use `X-Client-Request-Id` for observability.
  * Use `Idempotency-Key` for non-streaming `POST /v1/responses` or `POST /v1/chat/completions` when you need automatic SDK retries. Do not rely on it to deduplicate audio, image, embedding, rerank, streaming, or voice-pipeline requests.
  * For JSON, use `response_format` with JSON Schema (strict: true) when the selected model and backend support it.
  * For streaming, pass `stream: true` and iterate chunks. Do not retry a partially consumed stream.
  * For tools, use the OpenAI tools array shape.
  * For TTS, use a voice or reference-audio mode that the deployment explicitly supports.

  Do not:

  * Assume OpenAI model names (gpt-4o, etc.) resolve on RunInfra. They do not.
  * Assume `/v1/completions` (legacy, non-chat), `/v1/assistants`, `/v1/threads`, or `/v1/batches` exist. They do not today.
  * Send traffic from the browser. Always proxy through a server route.
  * Invent endpoints. Use only the listed endpoints or the dashboard snippet.
  * Retry streaming requests, embeddings, images, rerank, binary TTS, multipart ASR, or voice-pipeline calls blindly. Treat retries for those operations as possible second runs unless the dashboard or API response says otherwise.

  Reference docs:

  * RunInfra SDK: [https://runinfra.ai/docs/tools-sdks/runinfra-sdk](https://runinfra.ai/docs/tools-sdks/runinfra-sdk)
  * OpenAI compatibility: [https://runinfra.ai/docs/tools-sdks/openai-compatibility](https://runinfra.ai/docs/tools-sdks/openai-compatibility)
  * API reference: [https://runinfra.ai/docs/api-reference/introduction](https://runinfra.ai/docs/api-reference/introduction)
  * Cookbook: [https://runinfra.ai/docs/cookbook/overview](https://runinfra.ai/docs/cookbook/overview)
  * Rate limits: [https://runinfra.ai/docs/api-reference/rate-limits](https://runinfra.ai/docs/api-reference/rate-limits)
  * Error codes: [https://runinfra.ai/docs/api-reference/errors](https://runinfra.ai/docs/api-reference/errors)

  When unsure, pull the URL from the reference docs and cite it. Never invent endpoints.
</Prompt>

## How to use it

<Tabs>
  <Tab title="In a chat">
    Paste as the first message in a ChatGPT, Claude, or other LLM conversation, then ask for the code you want.
  </Tab>

  <Tab title="In a system prompt">
    Drop it into your agent's system prompt. Version the text so you can iterate safely.
  </Tab>

  <Tab title="In a project README">
    Keep it at the top of your project README so contributors, human or AI, pick it up automatically when they open the repo.
  </Tab>
</Tabs>

## Why this works

LLMs trained before a given cutoff do not know RunInfra specifically. They do know how to use OpenAI-compatible APIs and first-party SDKs. This prompt gives them the supported RunInfra endpoints, base URL rules, key-scope rules, retry rules, and model-ID guardrails.

## Next steps

<Columns cols={2}>
  <Card title="RunInfra SDK" icon="shield-check" href="/tools-sdks/runinfra-sdk">
    Native SDK setup for optimized deployment access.
  </Card>

  <Card title="OpenAI compatibility" icon="plug" href="/tools-sdks/openai-compatibility">
    The OpenAI-compatible contract this prompt refers to.
  </Card>

  <Card title="API reference" icon="square-terminal" href="/api-reference/introduction">
    Endpoint parameters and response shapes.
  </Card>

  <Card title="Integrations" icon="link" href="/integrations/overview">
    Framework-specific setup.
  </Card>
</Columns>
