To deploy a LangGraph application to LangGraph Cloud, your application code must reside in a GitHub repository. Both public and private repositories are supported. For this quickstart, use the pre-built Python ReAct agent template for your application:
Click the + New Deployment button. A modal will open where you can fill in the required fields.
If you are a first time user or adding a private repository that has not been previously connected, click the Import from GitHub button and follow the instructions to connect your GitHub account.
Select your ReAct Agent repository.
In the Environment Variables section, set the following secrets:
This may take about 15 minutes to complete. You can check the status in the Deployment details view.
3. Test your application in LangGraph Studio
Once your application is deployed:
Select the deployment you just created to view more details.
Click the LangGraph Studio button in the top right corner.
LangGraph Studio will open to display your graph.
[{: style="max-height:400px"}](deployment/img/09_langgraph_studio.png)
Sample graph run in LangGraph Studio.
4. Get the API URL for your deployment
In the Deployment details view in LangGraph, click the API URL to copy it to your clipboard.
Click the URL to copy it to the clipboard.
5. Test the API
You can now test the API:
=== "Python SDK (Async)"
1. Install the LangGraph Python SDK:
```shell
pip install langgraph-sdk
```
1. Send a message to the assistant (threadless run):
```python
from langgraph_sdk import get_client
client = get_client(url="your-deployment-url", api_key="your-langsmith-api-key")
async for chunk in client.runs.stream(
None, # Threadless run
"agent", # Name of assistant. Defined in langgraph.json.
input={
"messages": [{
"role": "human",
"content": "What is LangGraph?",
}],
},
stream_mode="updates",
):
print(f"Receiving new event of type: {chunk.event}...")
print(chunk.data)
print("\n\n")
```
=== "Python SDK (Sync)"
1. Install the LangGraph Python SDK:
```shell
pip install langgraph-sdk
```
1. Send a message to the assistant (threadless run):
```python
from langgraph_sdk import get_sync_client
client = get_sync_client(url="your-deployment-url", api_key="your-langsmith-api-key")
for chunk in client.runs.stream(
None, # Threadless run
"agent", # Name of assistant. Defined in langgraph.json.
input={
"messages": [{
"role": "human",
"content": "What is LangGraph?",
}],
},
stream_mode="updates",
):
print(f"Receiving new event of type: {chunk.event}...")
print(chunk.data)
print("\n\n")
```
=== "Javascript SDK"
1. Install the LangGraph JS SDK
```shell
npm install @langchain/langgraph-sdk
```
1. Send a message to the assistant (threadless run):
```js
const { Client } = await import("@langchain/langgraph-sdk");
const client = new Client({ apiUrl: "your-deployment-url", apiKey: "your-langsmith-api-key" });
const streamResponse = client.runs.stream(
null, // Threadless run
"agent", // Assistant ID
{
input: {
"messages": [
{ "role": "user", "content": "What is LangGraph?"}
]
},
streamMode: "messages",
}
);
for await (const chunk of streamResponse) {
console.log(`Receiving new event of type: ${chunk.event}...`);
console.log(JSON.stringify(chunk.data));
console.log("\n\n");
}
```