# Get the status of your key

> Plan, status, remaining credit and balance of your key.

`GET https://api.solvecha.com/v1/status`


Returns the plan of your key, how much of today's quota is left, and your balance. The request costs no quota and no balance.

## Authorization

Send your API key as `Authorization: Bearer YOUR_API_KEY`. Other ways are the `key` field of the body and the `key` query parameter. See [Authentication](https://solvecha.com/docs/authentication.md).

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `key` | string | No | Your API key, if you do not send it in the `Authorization` header. |

## Example request


**cURL**

```bash
curl "https://api.solvecha.com/v1/status" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

**Python**

```python
import requests

response = requests.get(
    "https://api.solvecha.com/v1/status",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(response.status_code, response.json())
```

**Node.js**

```js
const response = await fetch("https://api.solvecha.com/v1/status", {
  headers: { Authorization: "Bearer YOUR_API_KEY" },
});
console.log(response.status, await response.json());
```

**Go**

```go
package main

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

func main() {
	req, err := http.NewRequest("GET", "https://api.solvecha.com/v1/status", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	out, _ := io.ReadAll(resp.Body)
	fmt.Println(resp.StatusCode, string(out))
}
```


## Response

### 200 OK

The state of your key.

```json
{
  "plan": "Basic",
  "status": "Active",
  "credit": 44872,
  "quota": 20000,
  "duration": 86400,
  "lastreset": 1760486400,
  "ttl": 41200,
  "subscribed": 0,
  "current_period_start": 1760000000,
  "current_period_end": 1762600000,
  "balance_usd": "4.9998",
  "free_remaining": 0,
  "free_quota": 100
}
```

### Errors

An error has the HTTP status of its code and this body:

```json
{"error": 15, "code": 15, "message": "Invalid key", "type": null}
```

| Code | HTTP status | When |
|---|---|---|
| `11` Rate limit reached | 429 | More than 600 status requests per minute. |
| `15` Invalid key | 401 | The key is missing, malformed or unknown. |
| `9` Unknown error | 500 | Server error. Retry after a few seconds. |

All codes are on the [Errors](https://solvecha.com/docs/errors.md) page.

## Notes

`plan` is the name of your plan, `Free` if the key only has the free tier, `Pay per use` if it only has a balance, or `No plan`. `status` is `Active`, `Expired` or `Inactive` (no plan). `credit` is what your key can still solve: the remaining daily quota (plan or free) plus the balance converted to solves (balance divided by $0.0002). It counts down with each successful solve. `balance_usd` is the balance as a string with up to four decimals. `free_remaining` and `free_quota` are the remaining and the full free daily quota. The three last fields are additive: a NopeCHA client can ignore them. The quota window is the UTC day: `lastreset` is the start of today, `ttl` the seconds until the next reset. `subscribed` is always `0` and exists for compatibility with NopeCHA. The example values are made up.
