{"id":26584018,"url":"https://github.com/darrylschaefer/openai-legacy-completions","last_synced_at":"2026-04-20T10:31:26.860Z","repository":{"id":283309161,"uuid":"951352815","full_name":"darrylschaefer/openai-legacy-completions","owner":"darrylschaefer","description":"Playground for OpenAI's Legacy Completion API","archived":false,"fork":false,"pushed_at":"2025-03-19T14:54:27.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T15:39:08.851Z","etag":null,"topics":["api","babbage-002","chatgpt","davinci-002","legacy","openai","playground"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darrylschaefer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-03-19T14:46:02.000Z","updated_at":"2025-03-19T14:55:59.000Z","dependencies_parsed_at":"2025-03-20T02:03:09.904Z","dependency_job_id":null,"html_url":"https://github.com/darrylschaefer/openai-legacy-completions","commit_stats":null,"previous_names":["darrylschaefer/openai-legacy-completions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/darrylschaefer/openai-legacy-completions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrylschaefer%2Fopenai-legacy-completions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrylschaefer%2Fopenai-legacy-completions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrylschaefer%2Fopenai-legacy-completions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrylschaefer%2Fopenai-legacy-completions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darrylschaefer","download_url":"https://codeload.github.com/darrylschaefer/openai-legacy-completions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrylschaefer%2Fopenai-legacy-completions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32042962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","babbage-002","chatgpt","davinci-002","legacy","openai","playground"],"created_at":"2025-03-23T09:17:43.862Z","updated_at":"2026-04-20T10:31:26.840Z","avatar_url":"https://github.com/darrylschaefer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAI “Legacy” Completion Playground\n\nA Next.js web application that serves as an API playground to OpenAI’s Legacy Completion API (for those of us who still love that API endpoint!). It includes:\n\n- A collapsible “Settings” panel with controls for model, temperature, token usage, etc.\n- A textarea for user prompts.\n- A method to save all outputs to a local file (saved_outputs.txt).\n\n\n![image](https://github.com/user-attachments/assets/84e212c0-84fc-48dc-996a-055eb0a1050b)\n\n\n\nToggle a button to show/hide advanced settings, including:\n\n- Model selection (babbage-002, davinci-002, gpt-3.5-turbo-instruct)\n- Temperature, max_tokens, top_p, frequency_penalty, presence_penalty sliders\n- Optional output saving to file\n- Integration with the Legacy Completions Endpoint\n\nWhen “Save output to file” is checked, the response is appended to a local text file (saved_outputs.txt) in the project root folder.\n\n## Prerequisites\n\n- Node.js (v16 or newer recommended)\n- npm (or yarn)\n- An OpenAI API Key (sign up at https://platform.openai.com/)\n\n\n## Getting Started\nClone or Download the repository:\n\n- git clone https://github.com/your-username/openai-legacy-completions.git\n- cd openai-legacy-completions\n\nInstall Dependencies:\n\nnpm install\n\nSet Up Environment Variables:\n\nCreate a file named .env.local at the project root if it doesn’t already exist.\n\nAdd the following line, replacing INSERT OPENAI API KEY HERE with your actual OpenAI API key:\n\nOPENAI_API_KEY=\"YOUR_API_KEY\"\n\n.env.local is typically ignored by Git, so your API key remains private.\n\nRun the Development Server:\n\nnpm run dev\n\nBy default, this starts your app on http://localhost:3000.\n\n## Usage\n\nOpen the App\n- Navigate to http://localhost:3000 in your browser.\n\nEnter Your Prompt\n- Type the prompt or question you want to send to the OpenAI completion endpoint in the large textarea.\n\nAdjust Settings (optional)\n- Click “Hide Settings” / “Show Settings” to toggle the panel.\n- Choose the model (babbage-002, davinci-002, or gpt-3.5-turbo-instruct).\n- Adjust temperature, max tokens, top_p, frequency penalty, or presence penalty with the sliders.\n\nSave Output (optional)\n- Check “Save output to file” before clicking “Generate.”\n- The output is appended to saved_outputs.txt.\n\nGenerate\n- Click the “Generate” button.\n- The OpenAI response appears in the “Output” section below.\n\nDeployment\nIf you plan to deploy to a hosting platform:\n\n- Ensure the platform supports Node.js and Next.js 13.\n- For serverless platforms like Vercel, note that ephemeral file systems may prevent permanent saving of outputs. Use a more permanent storage (e.g., S3, a database) if needed.\n- Remember to set your OPENAI_API_KEY environment variable in the hosting service’s configuration.\n\n## Troubleshooting\n\n“404 Not Found” when hitting /api/completions\n- Check that your folder is exactly app/api/completions/route.js.\n- Confirm you restarted the dev server after creating the file.\n\n“Error calling OpenAI API” or “Request failed”\n- Verify your .env.local has the correct OPENAI_API_KEY.\n- Ensure your network/firewall isn’t blocking requests to the OpenAI endpoint.\n- Check logs in your terminal and/or browser console for more specific errors.\n\nOutputs not showing in saved_outputs.txt\n- Make sure you have the “Save output to file” checkbox selected before generating.\n- Check file permissions in your hosting environment, or confirm you’re running locally.\n\n## Contributing\n- Fork and clone the repo, then create a new branch for your feature or bug fix.\n- Open a Pull Request describing your changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarrylschaefer%2Fopenai-legacy-completions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarrylschaefer%2Fopenai-legacy-completions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarrylschaefer%2Fopenai-legacy-completions/lists"}