diff --git a/v1.0/SERVERLESS/custom-apis/using-your-api-copy.md b/v1.0/SERVERLESS/custom-apis/using-your-api-copy.md index 3a06996..cfd9cfa 100644 --- a/v1.0/SERVERLESS/custom-apis/using-your-api-copy.md +++ b/v1.0/SERVERLESS/custom-apis/using-your-api-copy.md @@ -170,7 +170,7 @@ running your api via **/run** runs the code asynchronously, here's a sample resp ```Text cURL curl https://api.runpod.ai/v2//status/ ``` -```python +```python Start a job and return a status # this requires the installation of runpod-python # with `pip install runpod-python` beforehand @@ -186,6 +186,18 @@ run_request = endpoint.run( print(run_request.status()) ``` +```python Get the status of a running job +# Prerequisite: Install runpod-python using `pip install runpod-python` +import runpod + +runpod.api_key = "xxxxxxxxxxxxxxxxxxxxxx" # Replace with your API key +client = runpod.endpoint.runner.RunPodClient() + + +job = runpod.endpoint.Job(endpoint_id="your_endpoint_id", job_id="your_job_id", client=client) + +print(job.status()) +``` **sample response (for job in progress)**