# Quick Start

Welcome to enfer.ai! In this quick start guide, we’ll show you how to call our OpenAI-compatible completion API directly or using the OpenAI SDK. You can easily integrate with your existing OpenAI-compatible code, making it straightforward to replace or augment your current setup with enfer.ai’s models.

### Authentication

1. **Sign up** for an account on [enfer.ai](https://enfer.ai/) (if you haven't already).
2. **Purchase credits** [in your enfer.ai account](https://enfer.ai/profile/credits) to continue usage.
3. **Create an API key** [in the account](https://enfer.ai/profile/keys). You’ll need this key when making requests to our API.

Once you have your API key, you’re ready to start calling the enfer.ai endpoints.

### Usage with the OpenAI Python SDK

### Installation

If you’re not already set up with the OpenAI Python SDK, install it first:

```bash
pip install openai
```

### Usage

Because enfer.ai is OpenAI-compatible, you can leverage your existing OpenAI SDK code with minimal changes. Just point to the enfer.ai base endpoint and use your **enfer.ai API key**.

#### Sample Code

```python
import openai

# Set the endpoint and API key for enfer.ai
openai.api_base = "https://api.enfer.ai/v1"
openai.api_key = "<YOUR_ENFER_API_KEY>"

# Example: Chat Completion
response = openai.ChatCompletion.create(
    model="mistralai/mistral-nemo",  # Example model name
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Why are we still here?"}
    ]
)

# Print the AI's reply
print(response.choices[0].message.content)

```

## Supported Features

* **Chat Completions**: Send a conversation-style prompt and receive a context-aware response.&#x20;
* **Completions**: Provide a text prompt to generate or continue content.
* **Streaming & Cancellation**: Optionally stream results in real-time and cancel ongoing requests if needed.
* **Model Listing**: Request and retrieve a list of supported models.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enfer-ai.gitbook.io/enfer.ai-docs/quick-start.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
