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

# Introduction

> Learn how to refine your AI interactions using the OpenGiant REST API.

<img className="rounded-xl" src="https://assets.basehub.com/61703dd0/6e330f8a932f09407980b95755a33b83/image.png?format=auto&width=1500" alt="Crocodile" noZoom />

<Note>
  This section covers the OpenGiant REST API, offering the same powerful features as our TypeScript SDK. Use it to refine AI responses and manage personas directly from your backend.
</Note>

## Welcome to the OpenGiant API

The OpenGiant REST API gives you **fine-grained control** over the tone, style, and personality of your AI-powered applications. Whether you're integrating with OpenAI, Anthropic, Cohere, or a custom LLM, our API helps ensure your AI sounds intentional, on-brand, and human.

If you're looking for SDK-based integration, head over to our [Quickstart Guide](/quickstart) for TypeScript.

## What You Can Do with the API

* **Refine AI Responses**: Pass raw LLM outputs through OpenGiant to shape responses that resonate.
* **Manage AI Personas**: Connect your applications to personas crafted in [OpenGiant Studio](https://studio.opengiant.com).
* **Ensure Brand Consistency**: Maintain a consistent tone and style across all user interactions.

## Authentication

All API requests require authentication using a Bearer token.

You’ll need two keys to get started:

* **OG Key**: Your personal API key from OpenGiant.
* **Provider API Key**: The API key from your chosen AI provider (e.g., OpenAI, Anthropic).

Include your OG Key in the `Authorization` header for all requests:

```http theme={null}
Authorization: Bearer YOUR_OG_KEY
```

## Base URL

All API requests are made to the following base URL:

```plaintext theme={null}
https://api.opengiant.com/v1
```

## Example Request

Here’s how you can refine an AI response using the API:

```bash theme={null}
curl -X POST https://api.opengiant.com/v1/refine \
  -H "Authorization: Bearer YOUR_OG_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "openai",
    "providerApiKey": "YOUR_PROVIDER_API_KEY",
    "personaId": "YOUR_PERSONA_ID",
    "content": "I can help with that. Please specify the issue you are facing."
  }'
```

Expected response:

```json theme={null}
{
  "response": "I’d be happy to help with your account statement! Could you tell a little more about the issue you’re facing?"
}
```
