[{"data":1,"prerenderedAt":128},["ShallowReactive",2],{"term-a\u002Fapi-key":3,"related-a\u002Fapi-key":114},{"id":4,"title":5,"acronym":6,"body":7,"category":96,"description":97,"difficulty":98,"extension":99,"letter":100,"meta":101,"navigation":59,"path":102,"related":103,"seo":108,"sitemap":109,"stem":112,"subcategory":6,"__hash__":113},"terms\u002Fterms\u002Fa\u002Fapi-key.md","API Key",null,{"type":8,"value":9,"toc":90},"minimark",[10,15,19,23,26,30,79,83,86],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 — The Vibe Check",[16,17,18],"p",{},"An API key is your password to use an AI service. You include it in every request to prove you're allowed to use the API and so they know who to charge. Guard it like your bank password — anyone who gets your API key can use it and you pay the bill. Never commit it to git. Never. Seriously.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"An API key is a unique identifier token used to authenticate requests to an API. For LLM APIs (OpenAI, Anthropic, Google), keys are used to authenticate, authorize, and track usage for billing. They should be stored as environment variables or secrets, never hardcoded in source code or committed to version control.",[11,27,29],{"id":28},"show-me-the-code","Show Me The Code",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import anthropic\nimport os\n\nclient = anthropic.Anthropic(\n    api_key=os.environ.get(\"ANTHROPIC_API_KEY\")  # never hardcode this\n)\n","python","",[38,39,40,48,54,61,67,73],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,47],{},"import anthropic\n",[41,49,51],{"class":43,"line":50},2,[41,52,53],{},"import os\n",[41,55,57],{"class":43,"line":56},3,[41,58,60],{"emptyLinePlaceholder":59},true,"\n",[41,62,64],{"class":43,"line":63},4,[41,65,66],{},"client = anthropic.Anthropic(\n",[41,68,70],{"class":43,"line":69},5,[41,71,72],{},"    api_key=os.environ.get(\"ANTHROPIC_API_KEY\")  # never hardcode this\n",[41,74,76],{"class":43,"line":75},6,[41,77,78],{},")\n",[11,80,82],{"id":81},"when-youll-hear-this","When You'll Hear This",[16,84,85],{},"\"Add your API key to the .env file.\" \u002F \"Someone leaked the API key — rotate it immediately.\"",[87,88,89],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":36,"searchDepth":50,"depth":50,"links":91},[92,93,94,95],{"id":13,"depth":50,"text":14},{"id":21,"depth":50,"text":22},{"id":28,"depth":50,"text":29},{"id":81,"depth":50,"text":82},"ai","An API key is your password to use an AI service. You include it in every request to prove you're allowed to use the API and so they know who to charge.","beginner","md","a",{},"\u002Fterms\u002Fa\u002Fapi-key",[104,105,106,107],"Rate Limit","Chat Completion","LLM","Streaming",{"title":5,"description":97},{"changefreq":110,"priority":111},"weekly",0.7,"terms\u002Fa\u002Fapi-key","PnJMW7w-wpWYXaloC_Nj2yR1RhzoaDwxbkObZxtyNyo",[115,118,122,125],{"title":105,"path":116,"acronym":6,"category":96,"difficulty":98,"description":117},"\u002Fterms\u002Fc\u002Fchat-completion","Chat Completion is the API pattern for having a back-and-forth conversation with an AI.",{"title":106,"path":119,"acronym":120,"category":96,"difficulty":98,"description":121},"\u002Fterms\u002Fl\u002Fllm","Large Language Model","An LLM is a humongous AI that read basically the entire internet and learned to predict what words come next, really really well.",{"title":104,"path":123,"acronym":6,"category":96,"difficulty":98,"description":124},"\u002Fterms\u002Fr\u002Frate-limit","A rate limit is the AI provider saying 'slow down, buddy.",{"title":107,"path":126,"acronym":6,"category":96,"difficulty":98,"description":127},"\u002Fterms\u002Fs\u002Fstreaming","Streaming is when the AI sends you its response word by word as it generates, instead of making you wait for the whole thing at once.",1776518252891]