> For the complete documentation index, see [llms.txt](https://ordino-ai.gitbook.io/ordino-ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ordino-ai.gitbook.io/ordino-ai/sdk-reference/services.md).

# Services

{% hint style="success" %}
**Good to know:** This document provides a step-by-step guide for setting up and using **`@ordino.ai/ordino-engine`** for API testing with **Cypress**. framework exposes the **Ordino Engine** directly, allowing test teams to build **custom service classes** that encapsulate business logic.
{% endhint %}

### Prerequisites

Before you begin, ensure the following dependencies and requirements are met:

| Requirement          | Version / Notes         |
| -------------------- | ----------------------- |
| **Node.js**          | `>= 22.x`               |
| **Cypress**          | `>= 13.x`               |
| **Package Manager**  | `npm` or `yarn`         |
| **Language Support** | TypeScript / JavaScript |

### Installation

Add **`@ordino.ai/ordino-engine`** to your Cypress project:

```bash
npm install @ordino.ai/ordino-engine@2.2.0-cy.8 --save-dev
```

***

A recommended directory layout for using **`@ordino.ai/ordino-engine`** with Cypress:

```bash
/ordino
  /e2e
    /api
      users.spec.ts
  /services
    add_user.ts
  /payloads
    user_info.ts
  /support
    commands.ts
cypress.config.ts
package.json
```

#### Directory / File Details

* **`/e2e/api/`**\
  Contains your **end-to-end test specifications**.
  * `users.spec.ts` → Example Cypress spec file testing user-related API endpoints.
* **`/services/`**\
  Houses **service classes** that encapsulate API calls and business logic.
  * `add_user.ts` → Example service class for handling user-related API operations.
* **`/payloads/`**\
  Stores **request/response payloads** used in tests.
  * `user_info.ts` → Example test payload for creating or validating users data.
* **`/support/`**\
  Contains Cypress **custom commands and global hooks**.
  * `commands.ts` → Extend Cypress with reusable commands for common actions.
* **`cypress.config.ts`**\
  Cypress configuration file. Define base URL, environment variables, and test settings here.
* **`package.json`**\
  Project dependencies, scripts, and metadata. Includes the installed **`@ordino.ai/ordino-engine`** package.

***

### Engine Import

In any **service** or **test file**, import the **HTTP API** from `@ordino.ai/ordino-engine`:

```typescript
import { ordinoSuite } from '@ordino.ai/ordino-engine';

const http = ordinoSuite.api(ApiServiceType.HTTP);
```

* **`ordinoSuite`** → Main entry point to the Ordino Engine.
* **`ApiServiceType.HTTP`** → Specifies that the API service should use HTTP as the communication layer.
* **`http`** → An initialized API client instance to perform requests.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://ordino-ai.gitbook.io/ordino-ai/sdk-reference/services.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
