You only need this
import { useBasicChatCompletions } from '@fencyai/react'export default function BasicChatCompletionExample() {const { createBasicChatCompletion, latest } = useBasicChatCompletions()const response = latest?.data?.responseconst error = latest?.errorconst loading = latest?.loadingreturn (<div><buttononClick={async () => {await createBasicChatCompletion({openai: {model: 'gpt-4o-mini',messages: [{ role: 'user', content: 'Hello, how are you?' }]}})}}disabled={loading}>Send Message</button>{error && <div>{error.message}</div>}{response && <div>{response}</div>}</div>)}
We know because we have tried and failed multiple times. This made us build Fency.ai so you don't have to do go through the same as us.
Choose the right plan for you
Choose the plan that fits your stage—from development to production.
Free
For customers in the development and integration phase.
Custom
For customers who are ready to go live.