> For the complete documentation index, see [llms.txt](https://shinkalabs.gitbook.io/hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shinkalabs.gitbook.io/hub/andromeda/sdks-and-tooling/samples.md).

# Code samples

The API is plain HTTPS with JSON bodies and an `X-Api-Key` header, so any HTTP client works. Below are the same call (estimate the cost of an operation) in a few languages. Swap in real endpoints from the [OpenAPI spec](https://api.andromedainfra.pro/openapi.json).

## curl

```bash
curl -X POST https://api.andromedainfra.pro/v1/pricing/estimate \
  -H "X-Api-Key: $ANDROMEDA_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "operations": ["ika.sign.submit"] }'
```

## Node (fetch)

```js
const res = await fetch("https://api.andromedainfra.pro/v1/pricing/estimate", {
  method: "POST",
  headers: {
    "X-Api-Key": process.env.ANDROMEDA_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ operations: ["ika.sign.submit"] }),
});
const data = await res.json();
```

## Go

```go
req, _ := http.NewRequest("POST",
    "https://api.andromedainfra.pro/v1/pricing/estimate",
    strings.NewReader(`{"operations":["ika.sign.submit"]}`))
req.Header.Set("X-Api-Key", os.Getenv("ANDROMEDA_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
```

## Python (requests)

```python
import os, requests

r = requests.post(
    "https://api.andromedainfra.pro/v1/pricing/estimate",
    headers={"X-Api-Key": os.environ["ANDROMEDA_KEY"]},
    json={"operations": ["ika.sign.submit"]},
)
print(r.json())
```

## Rust (reqwest)

```rust
let client = reqwest::Client::new();
let resp = client
    .post("https://api.andromedainfra.pro/v1/pricing/estimate")
    .header("X-Api-Key", std::env::var("ANDROMEDA_KEY")?)
    .json(&serde_json::json!({ "operations": ["ika.sign.submit"] }))
    .send()
    .await?;
```

## For real flows

* Add an `Idempotency-Key` header on mutating calls. See [Idempotency keys](/hub/andromeda/guides/idempotency.md).
* For `prepare -> submit` flows, sign the returned `unsignedTx` with your chain's signing library before calling submit. See [Custody-free model](/hub/andromeda/concepts/custody-free.md).
* For `challenge -> submit` flows, have the user sign the 32-byte challenge with their wallet or passkey, then submit the signature. See [Wallet-agnostic & challenge auth](/hub/andromeda/concepts/wallet-agnostic.md).
* To generate a full typed client instead of hand-writing requests, see [OpenAPI codegen](/hub/andromeda/sdks-and-tooling/codegen.md).


---

# 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:

```
GET https://shinkalabs.gitbook.io/hub/andromeda/sdks-and-tooling/samples.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.
