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

# Developer / API Copilot

> Answer questions about your API docs, then use interactive tools when users want to act.

## The problem

Developers ask the same integration questions, then immediately want to try the API call. Static docs can explain the endpoint, but they cannot help the user assemble or execute a request.

## Why Ragrails fits

Ragrails can ingest API responses and SDK docs, answer questions from that context, and use the interactive CLI tool loop for live page fetches or confirmed API calls.

| Need                              | Ragrails capability                          |
| --------------------------------- | -------------------------------------------- |
| Ingest API reference and SDK docs | [Extraction](/features/extraction)           |
| Answer integration questions      | [Chat](/features/chat)                       |
| Fetch live external docs          | [Agentic Tools](/capabilities/agentic-tools) |
| Build your own tool loop          | [Tool Calling](/capabilities/tool-calling)   |
| Stream chat progress              | [Streaming](/capabilities/streaming)         |

## Sample

<CodeGroup>
  ```python SDK theme={null}
  from ragrails import RagRails

  rag = RagRails(
      collection="devdocs",
      vector_store={"provider": "qdrant", "url": "http://localhost:6333"},
      embedding={"provider": "voyage", "model": "voyage-3"},
      llm={"provider": "openai", "model": "gpt-4o-mini"},
  )

  rag.ingest(
      api={"url": "https://api.example.com/openapi.json", "title": "API Reference"},
      urls="https://docs.example.com/sdk",
      storage={"collection": "devdocs"},
  )

  result = rag.chat("How do I create a customer?", history=[])
  print(result.answer)
  ```

  ```bash CLI theme={null}
  ragrails setup-url --browser chromium

  ragrails ingest \
    --api-url https://api.example.com/openapi.json \
    --source-url https://docs.example.com/sdk \
    --vector-db qdrant \
    --collection devdocs \
    --url http://localhost:6333 \
    --provider voyage \
    --model voyage-3

  ragrails chat "How do I create a customer?" \
    --vector-db qdrant \
    --collection devdocs \
    --url http://localhost:6333 \
    --embedder-provider voyage \
    --embedder-model voyage-3 \
    --llm-provider openai \
    --llm-model gpt-4o-mini
  ```

  ```bash REST API theme={null}
  curl -X POST http://127.0.0.1:8000/v1/pipelines/ingest \
    -H "Content-Type: application/json" \
    -d '{
      "api": {"url": "https://api.example.com/openapi.json", "title": "API Reference"},
      "urls": "https://docs.example.com/sdk",
      "embedding": {"provider": "voyage", "model": "voyage-3"},
      "storage": {"vector_db": "qdrant", "collection": "devdocs", "url": "http://localhost:6333"}
    }'

  curl -X POST http://127.0.0.1:8000/v1/chat \
    -H "Content-Type: application/json" \
    -d '{
      "query": "How do I create a customer?",
      "llm_provider": "openai",
      "llm_model": "gpt-4o-mini",
      "embedder_provider": "voyage",
      "embedder_model": "voyage-3",
      "vector_db": "qdrant",
      "collection": "devdocs",
      "url": "http://localhost:6333",
      "history": []
    }'
  ```
</CodeGroup>

## Interactive tool mode

Run the interactive CLI when the user wants to act, not just ask:

```bash CLI theme={null}
ragrails chat
```

Example prompt:

```text theme={null}
How do I create a customer? Then call the endpoint with my test key.
```

<Warning>Agentic tools (`web_fetch`, `api_call`) run in the interactive CLI and confirm side-effecting API calls before execution.</Warning>
