{"id":15641217,"url":"https://github.com/load1n9/openai","last_synced_at":"2025-04-15T17:42:17.690Z","repository":{"id":62422131,"uuid":"376845572","full_name":"load1n9/openai","owner":"load1n9","description":"Unofficial Deno wrapper for the Open Ai api","archived":false,"fork":false,"pushed_at":"2023-11-01T18:12:55.000Z","size":343,"stargazers_count":72,"open_issues_count":7,"forks_count":24,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-28T23:11:14.804Z","etag":null,"topics":["ai","chatgpt","chatgpt-api","collaborate","dall-e","dalle2","gpt","gpt-3","gpt-35-turbo","gpt-4","gpt4","gptchat","openai","openai-api","whisper","whisper-ai"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/load1n9.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-14T14:07:29.000Z","updated_at":"2025-02-21T15:53:57.000Z","dependencies_parsed_at":"2024-10-03T11:42:03.613Z","dependency_job_id":"b79c2239-1972-4384-ac75-927aebd4d391","html_url":"https://github.com/load1n9/openai","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/load1n9%2Fopenai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/load1n9%2Fopenai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/load1n9%2Fopenai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/load1n9%2Fopenai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/load1n9","download_url":"https://codeload.github.com/load1n9/openai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249121466,"owners_count":21216128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","chatgpt","chatgpt-api","collaborate","dall-e","dalle2","gpt","gpt-3","gpt-35-turbo","gpt-4","gpt4","gptchat","openai","openai-api","whisper","whisper-ai"],"created_at":"2024-10-03T11:41:52.540Z","updated_at":"2025-04-15T17:42:17.670Z","avatar_url":"https://github.com/load1n9.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unofficial Deno wrapper for the Open AI API\n\n[![Tags](https://img.shields.io/github/release/load1n9/openai)](https://github.com/load1n9/openai/releases)\n[![Doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/openai/mod.ts)\n[![Checks](https://github.com/load1n9/openai/actions/workflows/ci.yml/badge.svg)](https://github.com/load1n9/openai/actions/workflows/ci.yml)\n[![License](https://img.shields.io/github/license/load1n9/openai)](https://github.com/load1n9/openai/blob/master/LICENSE)\n\n## Usage\n\nYour Open AI Api key ([found here](https://beta.openai.com/account/api-keys)) is\nneeded for this library to work. We recommend setting it as an environment\nvariable. Here is a configuration example.\n\n```ts\nimport { OpenAI } from \"https://deno.land/x/openai/mod.ts\";\n\nconst openAI = new OpenAI(Deno.env.get(\"YOUR_API_KEY\")!);\n```\n\n### Completion\n\n```ts\nimport { OpenAI } from \"https://deno.land/x/openai/mod.ts\";\n\nconst openAI = new OpenAI(Deno.env.get(\"YOUR_API_KEY\")!);\n\nconst completion = await openAI.createCompletion({\n  model: \"davinci\",\n  prompt: \"The meaning of life is\",\n});\n\nconsole.log(completion.choices);\n```\n\n### Chat Completion\n\n```ts\nimport { OpenAI } from \"https://deno.land/x/openai/mod.ts\";\n\nconst openAI = new OpenAI(Deno.env.get(\"YOUR_API_KEY\")!);\n\nconst chatCompletion = await openAI.createChatCompletion({\n  model: \"gpt-3.5-turbo\",\n  messages: [\n    { \"role\": \"system\", \"content\": \"You are a helpful assistant.\" },\n    { \"role\": \"user\", \"content\": \"Who won the world series in 2020?\" },\n    {\n      \"role\": \"assistant\",\n      \"content\": \"The Los Angeles Dodgers won the World Series in 2020.\",\n    },\n    { \"role\": \"user\", \"content\": \"Where was it played?\" },\n  ],\n});\n\nconsole.log(chatCompletion);\n```\n\n### Image\n\n```ts\nimport { OpenAI } from \"https://deno.land/x/openai/mod.ts\";\n\nconst openAI = new OpenAI(Deno.env.get(\"YOUR_API_KEY\")!);\n\nconst image = await openAI.createImage({\n  prompt: \"A unicorn in space\",\n});\n\nconsole.log(image);\n```\n\n### Edit\n\n```ts\nimport { OpenAI } from \"https://deno.land/x/openai/mod.ts\";\n\nconst openAI = new OpenAI(Deno.env.get(\"YOUR_API_KEY\")!);\n\nconst edit = await openAI.createEdit({\n  model: \"text-davinci-edit-001\",\n  input: \"What day of the wek is it?\",\n  instruction: \"Fix the spelling mistakes\",\n});\n\nconsole.log(edit);\n```\n\n### Image Edit\n\n```ts\nimport { OpenAI } from \"https://deno.land/x/openai/mod.ts\";\n\nconst openAI = new OpenAI(Deno.env.get(\"YOUR_API_KEY\")!);\n\nconst imageEdit = await openAI.createImageEdit({\n  image: \"@otter.png\",\n  mask: \"@mask.png\",\n  prompt: \"A cute baby sea otter wearing a beret\",\n  n: 2,\n  size: \"1024x1024\",\n});\n\nconsole.log(imageEdit);\n```\n\n### Image Variation\n\n```ts\nimport { OpenAI } from \"https://deno.land/x/openai/mod.ts\";\n\nconst openAI = new OpenAI(Deno.env.get(\"YOUR_API_KEY\")!);\n\nconst imageVariation = await openAI.createImageVariation({\n  image: \"@otter.png\",\n  n: 2,\n  size: \"1024x1024\",\n});\n\nconsole.log(imageVariation);\n```\n\n### Audio Transcription\n\n```ts\nimport { OpenAI } from \"https://deno.land/x/openai/mod.ts\";\n\nconst openAI = new OpenAI(Deno.env.get(\"YOUR_API_KEY\")!);\n\nconst transcription = await openAI.createTranscription({\n  model: \"whisper-1\",\n  file: \"/path/to/your/audio/file.mp3\",\n});\n\nconsole.log(transcription);\n```\n\n## Maintainers\n\n- Dean Srebnik ([@load1n9](https://github.com/load1n9))\n- Lino Le Van ([@lino-levan](https://github.com/lino-levan))\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fload1n9%2Fopenai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fload1n9%2Fopenai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fload1n9%2Fopenai/lists"}