Learn how to refine your AI interactions using the OpenGiant REST API.
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.
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 for TypeScript.
Here’s how you can refine an AI response using the API:
Copy
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:
Copy
{ "response": "I’d be happy to help with your account statement! Could you tell a little more about the issue you’re facing?"}