# Connecting to the Hyperspace Server

The following describes how to create a local instance of the Hyperspace client, which will enable you to connect to the database through the Hyperspace API. Hyperspace provides you with a username, password and the address of the cloud machine to which you will connect using the Hyperspace API.

**To create a local instance of the Hyperspace client –**

Copy the following code snippet to enable a connection to the database through the Hyperspace API.

{% tabs %}
{% tab title="Python" %}
{% code lineNumbers="true" %}

```python
hyperspace_client = hyperspace.HyperspaceClientApi(host=host_address,
                                                   username=username,
                                                   password=password)
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
import io.hyperspace.client.HyperspaceClient;
HyperspaceClient hyperspaceClient = new HyperspaceClient(host, username, password);
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```javascript
const hs = require('hyperspace-js')
const hyperspaceClient = new hs.HyperspaceClient(host_address, username, password); 
```

{% endcode %}
{% endtab %}
{% endtabs %}

* Replace <mark style="color:purple;">host\_address</mark> with the address of the Hyperspace cloud machine that you will access. This will be provided to you by Hyperspace.
* Replace <mark style="color:purple;">username</mark> and <mark style="color:purple;">password</mark> with the user name and password provided to you by Hyperspace.

To check that the client is live, run the following command -

{% tabs %}
{% tab title="Python" %}
{% code lineNumbers="true" %}

```python
print(hyperspace_client.collections_info())
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
Object info = hyperspaceClient.collectionsInfo(); 
System.out.println(new Gson().toJson(info));
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```javascript
const { data } = await hyperspaceClient.info();
console.log(data);
```

{% endcode %}
{% endtab %}
{% endtabs %}

A status message similar to the following should appear –

{% code overflow="wrap" %}

```json
{'collections': {'qa_collection': {'creation_time': '2025-06-10T11:30:14Z', 'size': 29607}}}
```

{% endcode %}

If no status message appears, contact support for assistance.


---

# 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.hyper-space.io/hyperspace-docs/flows/setting-up/connecting-to-the-hyperspace-server.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.
