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

# Developer Guide

> Learn how to use the Pulze API effectively

## Developer Guide

Integrate Pulze's powerful AI capabilities into your applications by using our API. This guide will help you get started with making requests, selecting models, using feature flags, and leveraging plugins.

<AccordionGroup>
  <Accordion title="Making a General Request">
    To make a general request to the Pulze API, you can use the `chat/completions` endpoint. If you don't specify a model, Pulze automatically selects the best model available in your Space or organization. This is equivalent to setting `"model": "pulze"`.

    **Example:**

    ```bash theme={null}
    curl --request POST \
      --url https://api.pulze.ai/v1/chat/completions \
      --header 'Authorization: Bearer your-access-key' \
      --header 'Content-Type: application/json' \
      --data '{
      "messages": [
        {
          "role": "user",
          "content": "Tell me a joke."
        }
      ]
    }'
    ```

    In this example, Pulze will automatically select the most appropriate AI model to generate a response based on the available models in your Space or organization.
  </Accordion>

  <Accordion title="Targeting a Specific Model">
    If you want to use a specific AI model for your request, you can specify the model parameter in your request body.

    **Example:**

    ```bash theme={null}
    curl --request POST \
    --url https://api.pulze.ai/v1/chat/completions \
    --header 'Authorization: Bearer your-access-key' \
    --header 'Content-Type: application/json' \
    --data '{
    "model": "google/gemini-2.0-flash-exp",
    "messages": [
      {
        "role": "user",
        "content": "Tell me a joke."
      }
    ]
    }'
    ```

    By specifying the `model`, Pulze will use the `google/gemini-2.0-flash-exp` model to generate the response.
  </Accordion>

  <Accordion title="Targeting a Specific Plugin (Tool)">
    If you want to use a specific plugin (also known as a tool) in your request, you can specify it using the plugins parameter. This allows you to directly invoke the desired plugin to handle your request.

    **Example:**

    ```bash theme={null}
    curl --request POST \
    --url https://api.pulze.ai/v1/chat/completions \
    --header 'Authorization: Bearer your-access-key' \
    --header 'Content-Type: application/json' \
    --data '{
    "plugins": ["web-search"],
    "messages": [
      {
        "role": "user",
        "content": "How much energy do AI data centers consume?"
      }
    ]
    }'
    ```

    By specifying `"plugins": ["web-search"]`, you're instructing Pulze to use the Web Search plugin to gather up-to-date information to answer your query.
  </Accordion>

  <Accordion title="Using Feature Flags for Automatic Tool Selection">
    Pulze supports feature flags that can enhance the capabilities of your requests. By enabling the `auto_tools` feature flag, Pulze will automatically select and use the best tools (plugins) to fulfill the request based on its content.

    **Example:**

    ```bash theme={null}
    curl --request POST \
    --url https://api.pulze.ai/v1/chat/completions \
    --header 'Authorization: Bearer your-access-key' \
    --header 'Content-Type: application/json' \
    --header 'Pulze-Feature-Flags: { "auto_tools": "true" }' \
    --data '{
    "messages": [
      {
        "role": "user",
        "content": "Can you search the web for Pulze.ai?"
      }
    ]
    }'
    ```

    With `auto_tools` enabled, Pulze will automatically use the appropriate tool (e.g., the Web Search plugin) to fulfill the request.
  </Accordion>

  <Accordion title="Available Plugins">
    Pulze offers a variety of plugins to extend the functionality of your AI interactions. Below is a list of available plugins:

    * `space-search`: Search and reference data across all files in your Space.
    * `web-search`: Integrate real-time web search results into your conversations.
    * `image-generation-dalle`: Generate images based on provided context using DALL·E.
    * `transcribe-audio`: Transcribe audio files into text.
    * `x-post`: Post a tweet to X.

    You can specify any of these plugins in your requests to enhance the AI's capabilities according to your needs.
  </Accordion>
</AccordionGroup>
