{"id":16392938,"url":"https://github.com/0h-n0/openai_api_lang_comparison","last_synced_at":"2026-06-19T21:30:17.764Z","repository":{"id":168301386,"uuid":"644005992","full_name":"0h-n0/openai_api_lang_comparison","owner":"0h-n0","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-13T18:18:46.000Z","size":26077,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-04T00:32:34.587Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/0h-n0.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}},"created_at":"2023-05-22T15:54:11.000Z","updated_at":"2023-11-13T18:18:50.000Z","dependencies_parsed_at":"2023-11-13T19:50:30.750Z","dependency_job_id":null,"html_url":"https://github.com/0h-n0/openai_api_lang_comparison","commit_stats":null,"previous_names":["0h-n0/oepnai_api_lang_comparison","0h-n0/openai_api_lang_comparison"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0h-n0%2Fopenai_api_lang_comparison","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0h-n0%2Fopenai_api_lang_comparison/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0h-n0%2Fopenai_api_lang_comparison/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0h-n0%2Fopenai_api_lang_comparison/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0h-n0","download_url":"https://codeload.github.com/0h-n0/openai_api_lang_comparison/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240251723,"owners_count":19772011,"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":[],"created_at":"2024-10-11T04:51:48.538Z","updated_at":"2026-06-19T21:30:17.732Z","avatar_url":"https://github.com/0h-n0.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### OPENAI_API Comparison(gpt35t)\n\n\n|Lang|Curl|Rust|Python|Javascript(Node)|Go|AWS Lambda + Python|\n|--:|--:|--:|--:|--:|--:|--:|\n|Mean|1.673s|1.672s|2.330s|1.907s|1.729s|1.626|\n|Std|± 0.249s|± 0.257|± 0.387s|± 0.754s|± 0.265s|± 0.350s|\n|Max|2.156s|2.522s|3.427s|4.116s|2.468s|3.036s|\n|Min|1.328s|1.418s|1.838s|0.867s|1.358|1.261s|\n\n\n### Azure_OPENAI_API Comparison\n\n2023/11/14\n\n|Lang|Curl(gpt35t)|Rust|Python(gpt4)|Python(gpt35t16k)|Javascript(Node)|Go|AWS Lambda + Python|\n|--:|--:|--:|--:|--:|--:|--:|--:|\n|Mean|79.9ms|s|2.198s|1.019s|s|s|s|\n|Std|± 10.4ms|± s|± 1.366s|± 0.327s|± s|± s|± s|\n|Max|139.5ms|s|5.289s|2.073s|s|s|s|\n|Min|70.5ms|s|1.073s|0.327s|s|s|s|\n\n\n\n\u003e * 30 trials per language.\n\u003e * use Hyperfine\n\n# Azure OPENAI API\n\n```shell\n$ curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/gpt35t16k/chat/completions?api-version=2023-07-01-preview \\\n  -H \"Content-Type: application/json\" \\\n  -H \"api-key: $AZURE_OPENAI_API_KEY\" \\\n  -d '{\n     \"model\": \"gpt35\",\n     \"messages\": [{\"role\": \"user\", \"content\": \"hello\"}],\n     \"temperature\": 0.0,\n     \"max_tokens\": 800,\n     \"frequency_penalty\": 0.0,\n     \"presence_penalty\": 0.0,\n     \"top_p\": 1.0,\n     \"stop\": null\n   }'\n```\n\n\n# OpenAI API\n\n```shell\n$ curl https://api.openai.com/v1/chat/completions \\ \n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -d '{\n     \"model\": \"gpt-3.5-turbo\",\n     \"messages\": [{\"role\": \"user\", \"content\": \"hello\"}],\n     \"temperature\": 0.0,\n   }'\n```\n\n\n## Curl\n```shell\n$ curl --version                            \ncurl 7.68.0 (x86_64-pc-linux-gnu)\n```\n\n```bash\n$ hyperfine -i --warmup 5 -m 30 'bash ./native.sh'\n  Benchmark 1: bash ./native.sh\n  Time (mean ± σ):      1.673 s ±  0.249 s    [User: 0.008 s, System: 0.004 s]\n  Range (min … max):    1.328 s …  2.156 s    30 runs  \n```\n\n# Rust\n```shell\n$ cargo --version\ncargo 1.69.0 (6e9a83356 2023-04-12)\n$ cargo build --release\n```\n\n```shell\n$ hyperfine -i --warmup 5 -m 30 ./target/release/openai_rs \n  Benchmark 1: ./target/release/openai_rs\n  Time (mean ± σ):      1.672 s ±  0.257 s    [User: 0.006 s, System: 0.003 s]\n  Range (min … max):    1.418 s …  2.522 s    30 runs\n```\n\n# Python3.11\n\n```shell\n$ hyperfine -i --warmup 5 -m 30 'poetry run python openai_py/main.py'\n  Benchmark 1: poetry run python openai_py/main.py\n  Time (mean ± σ):      2.330 s ±  0.387 s    [User: 0.488 s, System: 0.054 s]\n  Range (min … max):    1.838 s …  3.427 s    30 runs  \n```\n\n# Go\n\n```shell\n$ go version\ngo version go1.20.4 linux/amd64\n$ go build -ldflags \"-s -w\"\n```\n\n```shell\n$ hyperfine -i --warmup 5 -m 30 ./mod           \n  Benchmark 1: ./mod\n  Time (mean ± σ):      1.729 s ±  0.265 s    [User: 0.011 s, System: 0.005 s]\n  Range (min … max):    1.358 s …  2.468 s    30 runs\n```\n\n# Typescript\n\n```shell\n$ tsc -v\nVersion 5.0.4\nnode --version\nv18.9.0\n```\n\n```shell\n$ hyperfine -i --warmup 5 -m 30 'node main.js'\n  Benchmark 1: node main.js\n  Time (mean ± σ):      1.907 s ±  0.754 s    [User: 0.075 s, System: 0.010 s]\n  Range (min … max):    0.867 s …  4.116 s    30 runs\n```\n\n# AWS Lambda + Python3.10\n\nThe codes are not provided yet\n```shell\n$ Benchmark 1: bash lambda.sh\n  Time (mean ± σ):      1.626 s ±  0.350 s    [User: 0.009 s, System: 0.002 s]\n  Range (min … max):    1.261 s …  3.036 s    30 runs\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0h-n0%2Fopenai_api_lang_comparison","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0h-n0%2Fopenai_api_lang_comparison","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0h-n0%2Fopenai_api_lang_comparison/lists"}