File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
apps/sim/app/api/copilot/api-keys Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,6 @@ Copilot is a Sim-managed service. To use Copilot on a self-hosted instance:
160160
161161- Go to https://sim.ai → Settings → Copilot and generate a Copilot API key
162162- Set ` COPILOT_API_KEY ` in your self-hosted environment to that value
163- - Host Sim on a publicly available DNS and set NEXT_PUBLIC_APP_URL and BETTER_AUTH_URL to that value ([ ngrok] ( https://ngrok.com/ ) )
164163
165164## Tech Stack
166165
Original file line number Diff line number Diff line change @@ -19,7 +19,10 @@ export async function GET(request: NextRequest) {
1919
2020 const res = await fetch ( `${ SIM_AGENT_API_URL } /api/validate-key/get-api-keys` , {
2121 method : 'POST' ,
22- headers : { 'Content-Type' : 'application/json' } ,
22+ headers : {
23+ 'Content-Type' : 'application/json' ,
24+ ...( env . COPILOT_API_KEY ? { 'x-api-key' : env . COPILOT_API_KEY } : { } ) ,
25+ } ,
2326 body : JSON . stringify ( { userId } ) ,
2427 } )
2528
@@ -61,7 +64,10 @@ export async function DELETE(request: NextRequest) {
6164
6265 const res = await fetch ( `${ SIM_AGENT_API_URL } /api/validate-key/delete` , {
6366 method : 'POST' ,
64- headers : { 'Content-Type' : 'application/json' } ,
67+ headers : {
68+ 'Content-Type' : 'application/json' ,
69+ ...( env . COPILOT_API_KEY ? { 'x-api-key' : env . COPILOT_API_KEY } : { } ) ,
70+ } ,
6571 body : JSON . stringify ( { userId, apiKeyId : id } ) ,
6672 } )
6773
You can’t perform that action at this time.
0 commit comments