I’m expecting a low detail image to cost 85 tokens, see this documentation.
However, I’m being charged about 1000 tokens per image. What am I doing that is causing this high price?
const messages = [
{
role: "system",
content: `Given a list of images, return a json that fills in the below json example template that describe the photos given.
{"rule": "brown_hair", "description": "This person has brown hair", "result": "no"},
`,
},
{
role: "user",
content: [
{
type: "text",
text: "Process the following images:",
},
...urls
.map((url) => [
{
type: "image_url",
image_url: {
url: url,
detail: "low",
},
},
])
.flat(),
],
},
] as ChatCompletionMessageParam[];
....
const requestBody = {
messages,
model: "gpt-4-turbo",
response_format: {type: "json_object"},
max_tokens: maxTokens,
};
const completion = await openai.chat.completions.create(
requestBody
);