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

# FAQ

> Answers to common questions about Yelu AI API compatibility, models, SDKs, keys, streaming, tools, and reliability.

<AccordionGroup>
  <Accordion title="Is Yelu compatible with the OpenAI API?">
    Yes. Use the OpenAI-compatible base URL `https://api.yelu.ai/v1`, provide a Yelu API key, and call supported endpoints with OpenAI request shapes. Model-specific capabilities can differ, so discover models and test the features you rely on.
  </Accordion>

  <Accordion title="Can I use the official OpenAI SDK?">
    Yes. Set `base_url` in Python, `baseURL` in JavaScript, or `option.WithBaseURL` in Go. See the [SDK guides](/en/sdk/python).
  </Accordion>

  <Accordion title="Which model names are available?">
    Availability is specific to your account. Call [`GET /v1/models`](/en/api-reference/models) and use a returned `id`; do not assume every provider model is enabled.
  </Accordion>

  <Accordion title="Should I use Chat Completions or Responses?">
    Use Responses for new agentic workflows that benefit from typed output items, tools, reasoning controls, or continuation with `previous_response_id`. Use Chat Completions when you need the broadest compatibility with existing OpenAI clients and message-based applications.
  </Accordion>

  <Accordion title="How do I keep an API key safe?">
    Store it in a server-side secret manager or environment variable. Never ship it in browser code, mobile apps, desktop binaries, public repositories, or client-visible logs. Use separate keys per environment and rotate exposed keys immediately.
  </Accordion>

  <Accordion title="Why does a model reject vision, tools, or JSON schema?">
    The endpoint can accept a field even when the selected model or routed provider does not support that capability. Select a compatible model, simplify the request, or use a documented fallback. Test capability-critical requests before production rollout.
  </Accordion>

  <Accordion title="What should I retry?">
    Retry `429` and temporary `5xx` failures with exponential backoff, jitter, and a small retry budget. Do not retry `400`, `401`, `403`, or `404` unchanged. See [Errors](/en/errors) and [Rate limits](/en/rate-limits).
  </Accordion>

  <Accordion title="Does streaming reduce cost?">
    Not inherently. Streaming improves time to first token and user experience, but generated tokens remain billable. A disconnected stream can also have usage before the client sees the final event.
  </Accordion>

  <Accordion title="Can I send requests from a browser?">
    Do not expose a long-lived Yelu key to browsers. Send the user request to your own authenticated backend, enforce authorization and budgets there, and have the backend call Yelu.
  </Accordion>

  <Accordion title="How do I report a reproducible API issue?">
    Record the endpoint, model, timestamp with timezone, HTTP status, error `type` and `code`, and a sanitized minimal request. Remove API keys, personal data, prompts, files, and tool secrets before sharing diagnostics through your Yelu support channel.
  </Accordion>
</AccordionGroup>

## Test connectivity

<CodeGroup>
  ```bash Curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -fsS https://api.yelu.ai/v1/models \
    -H "Authorization: Bearer $YELU_API_KEY" \
    | jq '.data[].id'
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const response = await fetch('https://api.yelu.ai/v1/models', {
    headers: { Authorization: `Bearer ${process.env.YELU_API_KEY}` },
  });
  if (!response.ok) throw new Error(await response.text());
  console.log((await response.json()).data.map((model) => model.id));
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import os
  import requests

  response = requests.get(
      "https://api.yelu.ai/v1/models",
      headers={"Authorization": f"Bearer {os.environ['YELU_API_KEY']}"},
      timeout=30,
  )
  response.raise_for_status()
  print([model["id"] for model in response.json()["data"]])
  ```
</CodeGroup>
