# Generate Keys

The KrypC wallet-dev Service API provides a "Generate Keys" feature, allowing users to obtain private keys, public keys, and addresses with ease.

This creates a wallet using this method.

## API Specification

## Generate Keys

<mark style="color:green;">`POST`</mark> `https://api.krypcore.com/api/v0/devWallet/generateKeys`

Generate Keys under the given instance.&#x20;

#### Headers

| Name                                            | Type   | Description            |
| ----------------------------------------------- | ------ | ---------------------- |
| DappId<mark style="color:red;">\*</mark>        | String | DappId                 |
| Authorization<mark style="color:red;">\*</mark> | String | User Auth key obtained |

{% tabs %}
{% tab title="200: OK SUCCESS" %}

```javascript
{
    "Data": {
        "address": "0x722b17B6802F609ba66xxxxxxxxxxxxxxxxx",
        "privateKey": "0xc1a009172xxxxxxxxxxxxxx",
        "publicKey": "0x04a85e6b0843c4c7dfb3de68a08b5b3792f852b1f1c9a69182c46876ac1132b168e7ccc1df78e102b5b334362ef341f98ea9xxxxxxxxxxxxxxx"
    },
    "Message": "Keys generated successfully",
    "Status": "SUCCESS"
}

```

{% endtab %}

{% tab title="401: Unauthorized Failure in authentication" %}

```
{
    "message": "Invalid API key in request"
}
```

{% endtab %}
{% endtabs %}

Take a look at how you might call this method using our official libraries, or via `curl`

{% tabs %}
{% tab title="curl" %}

```bash

curl --location --request POST 'https://api.krypcore.com/api/v0/devWallet/generateKeys' \
--header 'DappId: **********' \
--header 'Authorization: **********' \

```

{% endtab %}

{% tab title="Node.js (Fetch)" %}

```javascript

var myHeaders = new Headers();
myHeaders.append("DappId", "**********");
myHeaders.append("Authorization", "**********");

var raw = "";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.krypcore.com/api/v0/devWallet/generateKeys", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));


```

{% endtab %}

{% tab title="Python " %}

<pre class="language-python"><code class="lang-python"><strong>
</strong>import requests

url = "https://api.krypcore.com/api/v0/devWallet/generateKeys"

payload = ""
headers = {
  'DappId': '**********',
  'Authorization': '**********',
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)



</code></pre>

{% endtab %}

{% tab title="Golang" %}

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.krypcore.com/api/v0/devWallet/generateKeys"
  method := "POST"

  payload := strings.NewReader(``)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("DappId", "**********")
  req.Header.Add("Authorization", "**********")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endtab %}
{% endtabs %}


---

# 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.krypcore.com/dev-docs/api-reference/core-service-apis/wallet-manager/developer-wallet/generate-keys.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.
