{"id":2556,"date":"2025-09-22T09:26:54","date_gmt":"2025-09-22T07:26:54","guid":{"rendered":"https:\/\/blog.f12.no\/wp\/?p=2556"},"modified":"2025-12-29T09:13:44","modified_gmt":"2025-12-29T08:13:44","slug":"using-claude-code-with-github-copilot-a-guide","status":"publish","type":"post","link":"https:\/\/blog.f12.no\/wp\/2025\/09\/22\/using-claude-code-with-github-copilot-a-guide\/","title":{"rendered":"Using Claude Code with GitHub Copilot: A Guide"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignleft size-full is-resized\"><a href=\"https:\/\/blog.f12.no\/wp\/wp-content\/uploads\/2025\/09\/czNmcy1wcml2YXRlL3Jhd3BpeGVsX2ltYWdlcy93ZWJzaXRlX2NvbnRlbnQvbHIvcHgxMTA1NzYtaW1hZ2Uta3d2eTRhdnIta3d2eW54OGQuanBn.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/blog.f12.no\/wp\/wp-content\/uploads\/2025\/09\/czNmcy1wcml2YXRlL3Jhd3BpeGVsX2ltYWdlcy93ZWJzaXRlX2NvbnRlbnQvbHIvcHgxMTA1NzYtaW1hZ2Uta3d2eTRhdnIta3d2eW54OGQuanBn.webp\" alt=\"Free code computer screen image\" class=\"wp-image-2562\" style=\"width:418px;height:auto\" srcset=\"https:\/\/blog.f12.no\/wp\/wp-content\/uploads\/2025\/09\/czNmcy1wcml2YXRlL3Jhd3BpeGVsX2ltYWdlcy93ZWJzaXRlX2NvbnRlbnQvbHIvcHgxMTA1NzYtaW1hZ2Uta3d2eTRhdnIta3d2eW54OGQuanBn.webp 1024w, https:\/\/blog.f12.no\/wp\/wp-content\/uploads\/2025\/09\/czNmcy1wcml2YXRlL3Jhd3BpeGVsX2ltYWdlcy93ZWJzaXRlX2NvbnRlbnQvbHIvcHgxMTA1NzYtaW1hZ2Uta3d2eTRhdnIta3d2eW54OGQuanBn-300x200.webp 300w, https:\/\/blog.f12.no\/wp\/wp-content\/uploads\/2025\/09\/czNmcy1wcml2YXRlL3Jhd3BpeGVsX2ltYWdlcy93ZWJzaXRlX2NvbnRlbnQvbHIvcHgxMTA1NzYtaW1hZ2Uta3d2eTRhdnIta3d2eW54OGQuanBn-768x512.webp 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<pre class=\"wp-block-preformatted\">This setup works, but a bit complicated. I love Claude Code, but am using <a href=\"https:\/\/opencode.ai\/\">Opencode<\/a> right now for a simpler path and less token usage. It is not exactly the same, but close. You might want to test it. \u263a\ufe0f<\/pre>\n\n\n\n<p>Because we can&#8217;t send company information to just any LLM (in this case Anthropic), I wanted to use Claude Code with our company approved GitHub Copilot. We are already running agents in VSCode and IDEA, so sending requests to their LLMs is not new.<\/p>\n\n\n\n<p>After a bit of research, I found that Claude Code also has documentation for doing something similar to this, so it is not a very far-fetched way to use CC. The plan became:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set up Claude Code to communicate through a &#8220;translation layer&#8221; (proxy): <a href=\"https:\/\/docs.anthropic.com\/en\/docs\/claude-code\/llm-gateway\">https:\/\/docs.anthropic.com\/en\/docs\/claude-code\/llm-gateway<\/a><\/li>\n\n\n\n<li>Launch LiteLLM locally (can&#8217;t send traffic to them): <a href=\"https:\/\/docs.litellm.ai\/#quick-start-proxy---cli\">https:\/\/docs.litellm.ai\/#quick-start-proxy&#8212;cli<\/a><\/li>\n\n\n\n<li>Configure LiteLLM to use GitHub Copilot: <a href=\"https:\/\/docs.litellm.ai\/docs\/providers\/github_copilot\">https:\/\/docs.litellm.ai\/docs\/providers\/github_copilot<\/a><\/li>\n<\/ul>\n\n\n\n<p><strong>NOTE:<\/strong> It seems this setup doesn&#8217;t let me do proper tool calling. Claude Code tries to do a web search sometimes, and that just fails with a server error. So probably not supported on the Copilot side.<\/p>\n\n\n\n<p><strong>WARNING:<\/strong> It seems to use a lot more credits (Github Copilot quota) than the Copilot Agents in VSCode and IDEA. So be prepared to be out of credits by mid month like I was. <\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Setup steps<\/h1>\n\n\n\n<p>If you don&#8217;t want to follow these manually Kjetil J\u00f8rgensen-Dahl has codified them in this Github repository: <a href=\"https:\/\/github.com\/kjetiljd\/claude-code-over-github-copilot\">https:\/\/github.com\/kjetiljd\/claude-code-over-github-copilot<\/a><\/p>\n\n\n\n<p>Here are the manual steps I followed:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Create tokens and config<\/h2>\n\n\n\n<p>We randomize with uuidgen:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1.5rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * 1.5rem);line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly># Write to a file that we can use \n# again after reboot\necho LITELLM_MASTER_KEY=\"litellm-$(uuidgen)\" > litellm-keys.env\necho LITELLM_SALT_KEY=\"litellm-$(uuidgen)\" >> litellm-keys.env\n# Then we source these to bring them\n# into the environment. This has to \n# be the shell you run the litellm\n# command in.\nsource litellm-keys.env<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6A9955\"># Write to a file that we can use <\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\"># again after reboot<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">LITELLM_MASTER_KEY=&quot;litellm-$(<\/span><span style=\"color: #DCDCAA\">uuidgen<\/span><span style=\"color: #CE9178\">)&quot;<\/span><span style=\"color: #D4D4D4\"> &gt; <\/span><span style=\"color: #CE9178\">litellm-keys.env<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">LITELLM_SALT_KEY=&quot;litellm-$(<\/span><span style=\"color: #DCDCAA\">uuidgen<\/span><span style=\"color: #CE9178\">)&quot;<\/span><span style=\"color: #D4D4D4\"> &gt;&gt; <\/span><span style=\"color: #CE9178\">litellm-keys.env<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\"># Then we source these to bring them<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\"># into the environment. This has to <\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\"># be the shell you run the litellm<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\"># command in.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">source<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">litellm-keys.env<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#1E1E1E;color:#c7c7c7;font-size:12px;line-height:1;position:relative\">Bash<\/span><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">2. Create LiteLLM configuration<\/h2>\n\n\n\n<p>Create a config for LiteLLM and save to <code>copilot-config.yaml<\/code>:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1.5rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * 1.5rem);line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>model_list:\n  - model_name: gpt-4\n    litellm_params:\n      model: github_copilot\/gpt-4\n      extra_headers: {\"Editor-Version\": \"vscode\/1.85.1\", \"Copilot-Integration-Id\": \"vscode-chat\"}\n  - model_name: claude-opus-4\n    litellm_params:\n      model: github_copilot\/claude-opus-4\n      extra_headers: {\"Editor-Version\": \"vscode\/1.85.1\", \"Copilot-Integration-Id\": \"vscode-chat\"}\n  - model_name: claude-sonnet-4\n    litellm_params:\n      model: github_copilot\/claude-sonnet-4\n      extra_headers: {\"Editor-Version\": \"vscode\/1.85.1\", \"Copilot-Integration-Id\": \"vscode-chat\"}<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #569CD6\">model_list<\/span><span style=\"color: #D4D4D4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  - <\/span><span style=\"color: #569CD6\">model_name<\/span><span style=\"color: #D4D4D4\">: <\/span><span style=\"color: #CE9178\">gpt-4<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #569CD6\">litellm_params<\/span><span style=\"color: #D4D4D4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">      <\/span><span style=\"color: #569CD6\">model<\/span><span style=\"color: #D4D4D4\">: <\/span><span style=\"color: #CE9178\">github_copilot\/gpt-4<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">      <\/span><span style=\"color: #569CD6\">extra_headers<\/span><span style=\"color: #D4D4D4\">: {<\/span><span style=\"color: #CE9178\">&quot;Editor-Version&quot;<\/span><span style=\"color: #D4D4D4\">: <\/span><span style=\"color: #CE9178\">&quot;vscode\/1.85.1&quot;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #CE9178\">&quot;Copilot-Integration-Id&quot;<\/span><span style=\"color: #D4D4D4\">: <\/span><span style=\"color: #CE9178\">&quot;vscode-chat&quot;<\/span><span style=\"color: #D4D4D4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  - <\/span><span style=\"color: #569CD6\">model_name<\/span><span style=\"color: #D4D4D4\">: <\/span><span style=\"color: #CE9178\">claude-opus-4<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #569CD6\">litellm_params<\/span><span style=\"color: #D4D4D4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">      <\/span><span style=\"color: #569CD6\">model<\/span><span style=\"color: #D4D4D4\">: <\/span><span style=\"color: #CE9178\">github_copilot\/claude-opus-4<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">      <\/span><span style=\"color: #569CD6\">extra_headers<\/span><span style=\"color: #D4D4D4\">: {<\/span><span style=\"color: #CE9178\">&quot;Editor-Version&quot;<\/span><span style=\"color: #D4D4D4\">: <\/span><span style=\"color: #CE9178\">&quot;vscode\/1.85.1&quot;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #CE9178\">&quot;Copilot-Integration-Id&quot;<\/span><span style=\"color: #D4D4D4\">: <\/span><span style=\"color: #CE9178\">&quot;vscode-chat&quot;<\/span><span style=\"color: #D4D4D4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  - <\/span><span style=\"color: #569CD6\">model_name<\/span><span style=\"color: #D4D4D4\">: <\/span><span style=\"color: #CE9178\">claude-sonnet-4<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #569CD6\">litellm_params<\/span><span style=\"color: #D4D4D4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">      <\/span><span style=\"color: #569CD6\">model<\/span><span style=\"color: #D4D4D4\">: <\/span><span style=\"color: #CE9178\">github_copilot\/claude-sonnet-4<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">      <\/span><span style=\"color: #569CD6\">extra_headers<\/span><span style=\"color: #D4D4D4\">: {<\/span><span style=\"color: #CE9178\">&quot;Editor-Version&quot;<\/span><span style=\"color: #D4D4D4\">: <\/span><span style=\"color: #CE9178\">&quot;vscode\/1.85.1&quot;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #CE9178\">&quot;Copilot-Integration-Id&quot;<\/span><span style=\"color: #D4D4D4\">: <\/span><span style=\"color: #CE9178\">&quot;vscode-chat&quot;<\/span><span style=\"color: #D4D4D4\">}<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#1E1E1E;color:#c7c7c7;font-size:12px;line-height:1;position:relative\">YAML<\/span><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">3. Launch LiteLLM<\/h2>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1.5rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * 1.5rem);line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>$ pip install 'litellm&#91;proxy&#93;'\n# You only need the litellm \n# command the next time to launch\n$ litellm --config copilot-config.yaml<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">$<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">pip<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">install<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&#39;litellm&#91;proxy&#93;&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\"># You only need the litellm <\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\"># command the next time to launch<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">$<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">litellm<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">--config<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">copilot-config.yaml<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#1E1E1E;color:#c7c7c7;font-size:12px;line-height:1;position:relative\">Bash<\/span><\/div>\n\n\n\n<p>You might get some issues with this on a managed system like Ubuntu. If you need a local Python to do pip installs I recommend <a href=\"https:\/\/mise.jdx.dev\/lang\/python.html\">mise-en-place<\/a>.<\/p>\n\n\n\n<p>The first time you should see a message to authenticate GitHub. Go to the URL and enter the code to authenticate. Like this:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1.5rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * 1.5rem);line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>Please visit https:\/\/github.com\/login\/device \nand enter code XXXX-XXXX to authenticate.<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D4D4D4\">Please visit https:\/\/github.com\/login\/device <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">and enter code XXXX-XXXX to authenticate.<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#1E1E1E;color:#c7c7c7;font-size:12px;line-height:1;position:relative\">Markdown<\/span><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">4. Test the setup<\/h2>\n\n\n\n<p>Do a test request in another terminal:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1.5rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * 1.5rem);line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>$ curl --location 'http:\/\/0.0.0.0:4000\/chat\/completions' \\\n--header 'Content-Type: application\/json' \\\n--header 'Editor-Version: CommandLine\/1.0' \\\n--data '{\n  \"model\": \"gpt-4\",\n  \"messages\": &#91;\n    {\n      \"role\": \"user\",\n      \"content\": \"what llm are you\"\n    }\n  &#93;\n}'<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">$<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">curl<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">--location<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&#39;http:\/\/0.0.0.0:4000\/chat\/completions&#39;<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #D7BA7D\">\\<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">--header <\/span><span style=\"color: #CE9178\">&#39;Content-Type: application\/json&#39;<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #D7BA7D\">\\<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">--header <\/span><span style=\"color: #CE9178\">&#39;Editor-Version: CommandLine\/1.0&#39;<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #D7BA7D\">\\<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">--data <\/span><span style=\"color: #CE9178\">&#39;{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #CE9178\">  &quot;model&quot;: &quot;gpt-4&quot;,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #CE9178\">  &quot;messages&quot;: &#91;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #CE9178\">    {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #CE9178\">      &quot;role&quot;: &quot;user&quot;,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #CE9178\">      &quot;content&quot;: &quot;what llm are you&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #CE9178\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #CE9178\">  &#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #CE9178\">}&#39;<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#1E1E1E;color:#c7c7c7;font-size:12px;line-height:1;position:relative\">Bash<\/span><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">5. Configure Claude Code<\/h2>\n\n\n\n<p>When the curl is working and returning a response, we can move on.<\/p>\n\n\n\n<p>Configure Claude Code with the necessary variables. You can do this on a project basis, but I have added it to my user config. Look at the docs for possible locations. Open an editor to <code>~\/.claude\/settings.json<\/code> and add these variables:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1.5rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * 1.5rem);line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>\"env\": {\n  \"ANTHROPIC_AUTH_TOKEN\": \"litellm-UUID-MASTER-KEY-from-env-file\",\n  \"ANTHROPIC_BASE_URL\": \"http:\/\/localhost:4000\",\n  \"ANTHROPIC_MODEL\": \"claude-sonnet-4\",\n  \"ANTHROPIC_SMALL_FAST_MODEL\": \"gpt-4\"\n}<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #CE9178\">&quot;env&quot;<\/span><span style=\"color: #D4D4D4\">: {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #9CDCFE\">&quot;ANTHROPIC_AUTH_TOKEN&quot;<\/span><span style=\"color: #D4D4D4\">: <\/span><span style=\"color: #CE9178\">&quot;litellm-UUID-MASTER-KEY-from-env-file&quot;<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #9CDCFE\">&quot;ANTHROPIC_BASE_URL&quot;<\/span><span style=\"color: #D4D4D4\">: <\/span><span style=\"color: #CE9178\">&quot;http:\/\/localhost:4000&quot;<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #9CDCFE\">&quot;ANTHROPIC_MODEL&quot;<\/span><span style=\"color: #D4D4D4\">: <\/span><span style=\"color: #CE9178\">&quot;claude-sonnet-4&quot;<\/span><span style=\"color: #D4D4D4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #9CDCFE\">&quot;ANTHROPIC_SMALL_FAST_MODEL&quot;<\/span><span style=\"color: #D4D4D4\">: <\/span><span style=\"color: #CE9178\">&quot;gpt-4&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#1E1E1E;color:#c7c7c7;font-size:12px;line-height:1;position:relative\">JSON<\/span><\/div>\n\n\n\n<p>Tip: If you add these to your user config, you can disable it on a project basis by setting them to a blank string in the project config.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">6. Test Claude Code<\/h2>\n\n\n\n<p>Open Claude Code. You should see a box warning you that you are using <strong>http:\/\/localhost:4000<\/strong>. Try a query. \ud83d\ude42<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/blog.f12.no\/wp\/wp-content\/uploads\/2025\/09\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"745\" height=\"258\" src=\"https:\/\/blog.f12.no\/wp\/wp-content\/uploads\/2025\/09\/image.png\" alt=\"\" class=\"wp-image-2557\" srcset=\"https:\/\/blog.f12.no\/wp\/wp-content\/uploads\/2025\/09\/image.png 745w, https:\/\/blog.f12.no\/wp\/wp-content\/uploads\/2025\/09\/image-300x104.png 300w\" sizes=\"auto, (max-width: 745px) 100vw, 745px\" \/><\/a><\/figure>\n\n\n\n<p>Good luck! \ud83d\ude0a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This setup works, but a bit complicated. I love Claude Code, but am using Opencode right now for a simpler path and less token usage. It is not exactly the same, but close. You might want to test it. \u263a\ufe0f Because we can&#8217;t send company information to just any LLM (in this case Anthropic), I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7,4],"tags":[212,213,150],"class_list":["post-2556","post","type-post","status-publish","format-standard","hentry","category-development","category-tech","tag-ai","tag-ai-agents","tag-tools"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_likes_enabled":false,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.f12.no\/wp\/wp-json\/wp\/v2\/posts\/2556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.f12.no\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.f12.no\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.f12.no\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.f12.no\/wp\/wp-json\/wp\/v2\/comments?post=2556"}],"version-history":[{"count":7,"href":"https:\/\/blog.f12.no\/wp\/wp-json\/wp\/v2\/posts\/2556\/revisions"}],"predecessor-version":[{"id":2590,"href":"https:\/\/blog.f12.no\/wp\/wp-json\/wp\/v2\/posts\/2556\/revisions\/2590"}],"wp:attachment":[{"href":"https:\/\/blog.f12.no\/wp\/wp-json\/wp\/v2\/media?parent=2556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.f12.no\/wp\/wp-json\/wp\/v2\/categories?post=2556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.f12.no\/wp\/wp-json\/wp\/v2\/tags?post=2556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}