# Send your first API request

Make your first call to the gospace API to verify your setup, authenticate successfully, and retrieve live data from your workspace environment.

{% tabs %}
{% tab title="Node.js" %}

### Prerequisites

* Completed **Setup Your Development Environment**
* Node.js v18+ and npm v9+
* A valid gospace API key in your `.env` file

### 1. Install dependencies

If you haven’t already:

```bash
npm install @gospace-ai/api dotenv
```

### 2. Create a request script

Create `first-request.ts`:

```ts
import "dotenv/config";
import GospaceAI from "@gospace-ai/api";

async function main() {
  // Initialize the client with your API key
  const gospace = new GospaceAI(process.env.GOSPACE_API_KEY!, {
    // Optional: use sandbox when available
    // url: "https://sandbox.api.gospace.app",
  });

  // Example: fetch supported countries from the System API
  const res = await gospace.system.getCountries();

  // Print the response data
  console.log(JSON.stringify(res.data, null, 2));
}

main().catch((err) => {
  console.error("Request failed:", err);
  process.exit(1);
});
```

{% hint style="info" %}
Prefer TypeScript? Run with `tsx`. Prefer JavaScript? See the JS version below.
{% endhint %}

### 3. Run the script

With TypeScript (recommended):

```bash
npx tsx first-request.ts
```

{% endtab %}
{% endtabs %}
