#How 2 use this api?

1 messages · Page 1 of 1 (latest)

versed hornet
#

I have a code like this: ```ts
import OpenAI from "openai";
import * as config from "./local/config.json"
const openai = new OpenAI({apiKey: config.apikey, dangerouslyAllowBrowser: true });

export async function gpt(text: string): Promise<undefined> {
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [
{ role: "user", content: text },
],
});
console.log(completion.choices[0].message);
return undefined;
}

it's code from examples but getting answer is in async function because it uses await (idk how they in example use await not in it). After i put that function in console i see output in a screenshot
Seems like 1 request with 1 token is too much. In usage, i see zero api requests
versed hornet
brazen marten
versed hornet
#

ok, and what does mean "free trial" label over balance 0$?

brazen marten
#

the free trial program ended like a year ago and api is now paid only