How can I get authorization for langgraph cloud remote deployment? #174

Closed
opened 2026-02-15 17:16:45 -05:00 by yindo · 1 comment
Owner

Originally created by @edkesuma on GitHub (Feb 18, 2025).

Hi, I already deployed my graph on Langgraph Platform. It has successfully deployed.
Below, I try to query the cloud instance from JS with fetch.

const response = await fetch(`${process.env.LANGGRAPH_CLOUD_URL}/threads/${threadId}/runs/${runId}`, {
      headers: {
        'Authorization': `${process.env.LANGCHAIN_API_KEY}`,
        'Content-Type': 'application/json'
      }
    });

However, it returns "Invalid token". I know that my langchain API key is already correct as I could test the langgraph cloud locally with the CLI tool and log it to the same account.

TLDR: Where can I get my authorization token?

Originally created by @edkesuma on GitHub (Feb 18, 2025). Hi, I already deployed my graph on Langgraph Platform. It has successfully deployed. Below, I try to query the cloud instance from JS with fetch. ``` const response = await fetch(`${process.env.LANGGRAPH_CLOUD_URL}/threads/${threadId}/runs/${runId}`, { headers: { 'Authorization': `${process.env.LANGCHAIN_API_KEY}`, 'Content-Type': 'application/json' } }); ``` However, it returns "Invalid token". I know that my langchain API key is already correct as I could test the langgraph cloud locally with the CLI tool and log it to the same account. TLDR: Where can I get my authorization token?
yindo closed this issue 2026-02-15 17:16:45 -05:00
Author
Owner

@dqbd commented on GitHub (Jun 17, 2025):

Hello! I think the code snippet should be as follows

const response = await fetch(
  `${process.env.LANGGRAPH_CLOUD_URL}/threads/${threadId}/runs/${runId}`,
  {
    headers: {
      Authorization: `Bearer ${process.env.LANGCHAIN_API_KEY}`,
      "Content-Type": "application/json",
    },
  }
);

Also: consider implementing custom authentication to avoid exposing your LangSmith API key
https://langchain-ai.github.io/langgraphjs/how-tos/auth/custom_auth/#3-connect-from-the-client

@dqbd commented on GitHub (Jun 17, 2025): Hello! I think the code snippet should be as follows ``` const response = await fetch( `${process.env.LANGGRAPH_CLOUD_URL}/threads/${threadId}/runs/${runId}`, { headers: { Authorization: `Bearer ${process.env.LANGCHAIN_API_KEY}`, "Content-Type": "application/json", }, } ); ``` Also: consider implementing custom authentication to avoid exposing your LangSmith API key https://langchain-ai.github.io/langgraphjs/how-tos/auth/custom_auth/#3-connect-from-the-client
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#174