# Quick Start

## Introduction

***

Welcome to the Cloud4.ai (C4AI) SDK Quick Start guide! This guide will walk you through the setup process and provide examples for using the C4AI SDK.\
\
The SDK provides a comprehensive set of functionality to communicate with C4AI managed Services using Object-Oriented Programming (OOP) style. Leveraging entities and the request structure, you can construct complex pipelines for parameter injection, service execution, and AI management with ease.

The SDK is built on the Command concept. To make requests to the system, you need to create a command object and pass it through the universal entry point under the EES service. This quickstart guide offers simple examples of execution and request structure. For more details, explore each service directly.

> &#x20;**Note:**  For further details, explore each service directly.&#x20;

## Installation

***

To get started, you need to install the C4AI SDK package. You can install it via npm:

```bash
npm install @c4ai/sdk-node
```

## Authentication

***

Before using the SDK, you need to authenticate your application.

> To locate your credentials, visit the following link: [API Credentials](https://console.cloud4.ai/organization?tab=api-credentials) or learn more about setting up organization and credentials: [Organization Structure](/concept/organization-structure.md#api-credentials)

In a basic scenario, you can provide credentials via environment variables. To load them, you can utilize packages like dotenv ([dotenv](https://www.npmjs.com/package/dotenv/v/14.0.0)) or similar. Regardless of the approach used to provide credentials, the SDK will automatically authenticate during the execution of actual commands.

```javascript
import { C4AI_SDK_Context } from "@c4ai/sdk-node";

const C4AI_CLIENT_ID = process.env.C4AI_CLIENT_ID!;
const C4AI_CLIENT_SECRET = process.env.C4AI_CLIENT_SECRET!;

C4AI_SDK_Context.setCredentials(
    C4AI_CLIENT_ID,
    C4AI_CLIENT_SECRET
);
```

> **Note:** For more information on SDK configurations and authentication approaches, refer to the section: [Authentication](/sdk/authentication.md)

## Usage Example

***

Here's a simple example of usage using Elastic Endpoint (EES) and AI API Connector (AAC):

```javascript
import { config } from 'dotenv';
config();
import {
    C4AI_AAC,
    C4AI_EES,
    C4AI_EES_ExecutionOptions,
    C4AI_RequestParameter,
    C4AI_RequestParameters,
    C4AI_SDK_TYPES__EES_ExecutionPriority
} from 'c4ai-node';

(async () => {
    const eesSic = "sic@0000000001:ees:0000000001";
    const aacSic = "sic@0000000001:aac-instance:0000000001";

    const command = new C4AI_EES.Commands.EXECUTE({
        service: new C4AI_EES(eesSic),
        command: new C4AI_AAC.Commands.EXECUTE({
            service: new C4AI_AAC(aacSic),
            parameters: new C4AI_RequestParameters(
                new C4AI_RequestParameter('system_role', 'You\'re a friendly giraffe!'),
                new C4AI_RequestParameter('user_input', 'How long is your neck?'),
            )
        }),
        options: new C4AI_EES_ExecutionOptions({
            priority: C4AI_SDK_TYPES__EES_ExecutionPriority.INSTANT
        })
    });

    const response = await command.execute();

    console.log(response)
})();
```

That's it! You're now ready to start using the Cloud4.ai SDK in your applications.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloud4.ai/sdk/quick-start.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
