Simple API endpoint for image alt description generation, powered by OpenAI GPT-4 with Vision.
This is inspired by Ice Cubes. It's really cool.
- Written in Deno.
- Serverless, on Deno Deploy.
- There's no front-end.
- Uses OpenAI GPT-4 with Vision.
Requires Deno.
Add environment variable OPENAI_API_KEY
. Could create a .env
file and put the variable there too.
deno task dev
- Run the server with watch mode, for development.deno task debug
- Run the server with watch mode and debugging, for development.deno task start
- Run the server.
Additional environment variables:
OPENAI_MODEL
- OpenAI model to use, defaults togpt-4o
.
GET /?image=<image-url>
POST /
withimage
key asmultipart/form-data
.
Response:
{
"description": "a picture of a cat"
}
Error response:
{
"error": "Failed to generate description"
}
MIT.