Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vedpatwardhan committed Aug 29, 2024
1 parent bb89b8e commit 4cbcec2
Show file tree
Hide file tree
Showing 52 changed files with 2,455 additions and 1,931 deletions.
84 changes: 0 additions & 84 deletions api-reference/benchmarks/filter_benchmark.mdx

This file was deleted.

76 changes: 0 additions & 76 deletions api-reference/benchmarks/get_latest_benchmark.mdx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 'Get Credits'
api: 'GET /v0/get_credits'
api: 'GET /v0/credits'
---
Returns the number of available credits.

Expand All @@ -14,14 +14,14 @@ Returns the number of available credits.

```bash cURL
curl --request GET \
--url 'https://api.unify.ai/v0/get_credits' \
--url 'https://api.unify.ai/v0/credits' \
--header 'Authorization: Bearer <UNIFY_KEY>'
```

```python Python
import requests

url = "https://api.unify.ai/v0/get_credits"
url = "https://api.unify.ai/v0/credits"

headers = {"Authorization": "Bearer <token>"}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'Credits Code'
title: 'Promo Code'
api: 'POST /v0/promo'
---
Activates a promotional code.
Expand All @@ -16,7 +16,7 @@ Activates a promotional code.
Promo code to be activated.
</ParamField>

<ParamField query="user" type="string | null" >
<ParamField query="user" type="string" >
ID of the user that receives the credits,defaults to the user making the request.
</ParamField>

Expand Down Expand Up @@ -45,7 +45,7 @@ print(response.text)

```json 200
{
"info": "Code {code} activated succesfully!"
"info": "Code {code} activated successfully!"
}
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
---
title: 'Create Custom API Key'
api: 'PUT /v0/custom_api_key'
api: 'POST /v0/custom_api_key'
---
Stores a custom API key from a LLM provider in your account. This can be used in two ways:
1. As part of a custom endpoint. If you define a custom endpoint, you can reference a custom API
key. This will be sent to the endpoint as part of the request.
2. To use your own API keys in standard providers. If any of your custom API keys matches a provider
name and you pass `use_custom_keys=True` to the `/chat/completions` endpoint, this API key will
be used, charging your account directly instead of consuming Unify credits.
Stores a custom API key from an LLM provider in your account. This can be done in
one of two ways:

1. As part of a custom endpoint. If you define a custom endpoint, you can reference
a custom API key. This will be sent to the endpoint as part of the request.

2. To use your own API keys with the standard providers. If any of your custom API
keys match a provider name and you pass `use_custom_keys=True` to the
`/chat/completions` endpoint, then this API key will be used, using your own
account with the provider directly.

#### Authorizations

Expand All @@ -17,7 +21,7 @@ be used, charging your account directly instead of consuming Unify credits.

#### Query Parameters

<ParamField query="key" type="string" required="true">
<ParamField query="name" type="string" required="true">
Name of the API key.
</ParamField>

Expand All @@ -28,19 +32,19 @@ Value of the API key.
<RequestExample>

```bash cURL
curl --request PUT \
--url 'https://api.unify.ai/v0/custom_api_key?key=key1&value=value1' \
curl --request POST \
--url 'https://api.unify.ai/v0/custom_api_key?name=key1&value=value1' \
--header 'Authorization: Bearer <UNIFY_KEY>'
```

```python Python
import requests

url = "https://api.unify.ai/v0/custom_api_key?key=key1&value=value1"
url = "https://api.unify.ai/v0/custom_api_key?name=key1&value=value1"

headers = {"Authorization": "Bearer <token>"}

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

print(response.text)
```
Expand All @@ -50,7 +54,7 @@ print(response.text)

```json 200
{
"info": "API key created succesfully!"
"info": "API key created successfully!"
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Delete Custom API Key'
api: 'DELETE /v0/custom_api_key'
---
Deletes a custom API key in your account.
Deletes the custom API key from your account.

#### Authorizations

Expand All @@ -12,22 +12,22 @@ Deletes a custom API key in your account.

#### Query Parameters

<ParamField query="key" type="string" required="true">
<ParamField query="name" type="string" required="true">
Name of the custom API key to delete.
</ParamField>

<RequestExample>

```bash cURL
curl --request DELETE \
--url 'https://api.unify.ai/v0/custom_api_key?key=key1' \
--url 'https://api.unify.ai/v0/custom_api_key?name=key1' \
--header 'Authorization: Bearer <UNIFY_KEY>'
```

```python Python
import requests

url = "https://api.unify.ai/v0/custom_api_key?key=key1"
url = "https://api.unify.ai/v0/custom_api_key?name=key1"

headers = {"Authorization": "Bearer <token>"}

Expand All @@ -41,7 +41,7 @@ print(response.text)

```json 200
{
"info": "API key deleted succesfully!"
"info": "API key deleted successfully!"
}
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: 'Return Eval Config'
api: 'GET /v0/evals/get_config'
title: 'Get Custom API Key'
api: 'GET /v0/custom_api_key'
---
Returns the configuration JSON for a named eval.
Returns the value of the key for the specified custom API key name.

#### Authorizations

Expand All @@ -12,22 +12,22 @@ Returns the configuration JSON for a named eval.

#### Query Parameters

<ParamField query="eval_name" type="string" required="true">
Name of the eval to return the configuration of
<ParamField query="name" type="string" required="true">
Name of the API key to get the value for.
</ParamField>

<RequestExample>

```bash cURL
curl --request GET \
--url 'https://api.unify.ai/v0/evals/get_config?eval_name=eval1' \
--url 'https://api.unify.ai/v0/custom_api_key?name=key1' \
--header 'Authorization: Bearer <UNIFY_KEY>'
```

```python Python
import requests

url = "https://api.unify.ai/v0/evals/get_config?eval_name=eval1"
url = "https://api.unify.ai/v0/custom_api_key?name=key1"

headers = {"Authorization": "Bearer <token>"}

Expand All @@ -40,7 +40,10 @@ print(response.text)
<ResponseExample>

```json 200
{}
{
"key": "string",
"value": "string"
}
```

```json 422
Expand Down
Loading

0 comments on commit 4cbcec2

Please sign in to comment.