---
id: getting-started
title: Getting Started
hide_title: false
hide_table_of_contents: false
description: Get up to speed with SAP Cloud SDK for AI in no time
keywords:
  - sap
  - cloud
  - sdk
  - ai
  - getting started
---

### What You'll Build

In this quickstart, you'll use the OpenAI GPT-5 model via the [Orchestration Service of AI Core](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/orchestration) to generate text.
The application will send a prompt to the AI model and display the generated response.

### Prerequisites

Refer to prerequisites outlined [here](./overview-cloud-sdk-for-ai-js#prerequisites).

This quickstart assumes you are using the `default` resource group of your AI Core instance.
If you need to [use a different resource group](orchestration/chat-completion#custom-deployment-configuration), make sure it has an [orchestration deployment](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-deployment-for-orchestration) available.

### Add `@sap-ai-sdk/orchestration` as a Dependency

```bash
npm install @sap-ai-sdk/orchestration
```

### Use the Orchestration API

Initialize an orchestration client with an LLM model and a prompt template.

```ts
import { OrchestrationClient } from '@sap-ai-sdk/orchestration';

const orchestrationClient = new OrchestrationClient({
  promptTemplating: {
    model: {
      name: 'gpt-5'
    },
    prompt: {
      template: [
        { role: 'user', content: 'Answer the question: {{?question}}' }
      ]
    }
  }
});
```

Next, send a chat completion request with a value defined for the `question` input parameter.
The value replaces the `{{?question}}` placeholder in the template.

```ts
const response = await orchestrationClient.chatCompletion({
  placeholderValues: {
    question: 'Why is the phrase "Hello world!" so famous?'
  }
});
console.log(response.getContent());
```

Use `getContent()` method to get the generated text.

### Run the Application Locally

Define the `AICORE_SERVICE_KEY` environment variable with your AI Core service key in a `.env` file.

```txt
AICORE_SERVICE_KEY='{
  "clientid": "...",
  ...
}'
```

Load the `.env` file by using [dotenv](https://www.npmjs.com/package/dotenv) or running `node --env-file=.env ...`.

Refer to [Providing a Service Binding Locally](connecting-to-ai-core#providing-a-service-binding-locally) section for more information.
