> For the complete documentation index, see [llms.txt](https://infinitode-docs.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infinitode-docs.gitbook.io/documentation/api-documentation/dungen-dev-api-documentation.md).

# Dungen Dev API Documentation

This API allows you to use Dungen Dev, a name-generation model that produces names from a free-text prompt. The endpoint is a standard API; the model behind it is an experimental testing model.

Dungen Dev generates a name from a free-text `prompt`. "Dev" is part of the product's name, **not** a key type — you call this endpoint with your standard API key (`INF-`), exactly like every other API.

{% hint style="info" %}
**Model status.** This is a standard API, not an Experimental API. What's experimental is the **testing model** behind it: the model is still being tested and refined, while the endpoint itself is production-shaped and stable. Treat the names it generates as suggestions rather than fixed output.
{% endhint %}

## :rocket: Quickstart Using cURL

```bash
curl -X POST "https://infinitode.netlify.app/api/v1/dungen-dev" \
     -H "Content-Type: application/json" \
     -d '{"apiKey": "YOUR_API_KEY", "prompt": "A female character name", "nextWords": 20, "temperature": 0.5}'
```

## Changelog

* **1.0 (Latest)**: Initial commit for API space.

## Access

The API can be accessed from

```html
https://infinitode.netlify.app/api/v1/dungen-dev
```

***

## Authentication

### Bearer

This API uses Bearer Token authentication. Include your standard API key in the `Authorization` header of your request.

```
Authorization: Bearer YOUR_API_KEY
```

{% hint style="info" %}
You can also use the API with the default `GET` method, and continue to use the default `apiKey` or `token` parameters. When using the authorization bearer, `apiKey` or `token` parameters are automatically ignored.
{% endhint %}

### API Token

Alternatively, pass your **standard API key** as a request parameter instead of a header: as the `apiKey` field in the JSON body for `POST`, or as the `token` query parameter for `GET`.

```json
{
  "apiKey": "YOUR_API_KEY"
}
```

You can also use the API with the default `GET` method.

```url
https://infinitode.netlify.app/api/v1/dungen-dev?token=YOUR_API_KEY
```

***

## Endpoint

### Generate A Name

Endpoint URL:

```
https://infinitode.netlify.app/api/v1/dungen-dev
```

HTTP Methods:

* `Post`
* `Get`

Request Body

The request body should be a JSON object with the following properties:

* `apiKey`: Your API token.
* `prompt`: Your prompt to control name generation, e.g. "A female character name". Your prompt should have a maximum length of `50 characters`.
* `nextWords`: The amount of the next tokens. Ranges between `1-100`.
* `temperature`: Lower values = more probabilistic, higher values = more creative. Ranges from `0.001 - 1`.

Example:

```json
{
  "apiKey": "YOUR_API_KEY",
  "prompt": "A female character name",
  "nextWords": 20,
  "temperature": 0.5
}
```

Or, use the `GET` method:

{% code overflow="wrap" %}

```url
https://infinitode.netlify.app/api/v1/dungen-dev?token=YOUR_API_KEY&prompt=A female character name&nextWords=20&temperature=0.5
```

{% endcode %}

{% hint style="warning" %}
The `GET` method for this API may not work well, due to the complexities of prompts and URL formatting issues. Preprocessing prompts for a cleaner URL are recommended.
{% endhint %}

Response

Upon a successful request, using the Dungen Dev AI model you will receive a JSON response with the generated name and your prompt. If the API token is invalid or the request fails, an error message will be included in the response.

Example response:

```json
{
    "name": "Radiant Echoes",
    "prompt": "a game studio name"
}
```

The response contains the generated name and your prompt.

***

## Usage example

Here's a usage example in JavaScript using the `fetch` API:

```javascript
const apiUrl = 'https://infinitode.netlify.app/api/v1/dungen-dev';

const data = {
  "apiKey": "YOUR_API_KEY",
  "prompt": "A female character name",
  "nextWords": 20,
  "temperature": 0.5
};

fetch(apiUrl, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(data),
})
  .then(response => response.json())
  .then(result => {
    console.log('Generated name:', result.name);
  })
  .catch(error => {
    console.error('Error:', error);
  });
```

Make sure to replace `'YOUR_API_KEY'` with your actual API token.

{% hint style="warning" %}
This example puts your API key in the code, which is fine on your own machine while you test — but don't ship it in a public website or app: anyone can open the browser's developer tools, copy it, and spend your calls. To try the request without a key at all, use mock mode in the [API playground](https://infinitode.netlify.app/api/playground). In production, call the API from your own server or a serverless function, and have your front end call that. See [Keeping your API key safe](/documentation/api-documentation/keeping-your-api-key-safe.md).
{% endhint %}

***

## Error handling

The API may return error responses in case of invalid input or other issues. Be sure to handle errors gracefully in your application. Error responses will include appropriate status codes and error messages in the JSON format.

***

## Parameters

Here are all the available parameters for the API:

#### `POST` method

| Parameter     | Description                                                                                                                                                                       | Optional |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| `apiKey`      | Your standard API key (`INF-`)                                                                                                                                                    | `false`  |
| `prompt`      | Your prompt to control name generation, e.g. "A female character name". Your prompt should have a maximum length of `50 characters`.                                              | `false`  |
| `nextWords`   | The next tokens `number` to generate, ranges from `1 - 100`.                                                                                                                      | `false`  |
| `temperature` | The creativity of the model during generation `number`, lower values yield more balanced and probabilistic results, and higher values are more creative. Ranges from `0.001 - 1`. | `false`  |

#### `GET` method

| Parameter     | Description                                                                                                                                                                       | Optional |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| `token`       | Your standard API key (`INF-`)                                                                                                                                                    | `false`  |
| `prompt`      | Your prompt to control name generation, e.g. "A female character name". Your prompt should have a maximum length of `50 characters`.                                              | `false`  |
| `nextWords`   | The next tokens `number` to generate, ranges from `1 - 100`.                                                                                                                      | `false`  |
| `temperature` | The creativity of the model during generation `number`, lower values yield more balanced and probabilistic results, and higher values are more creative. Ranges from `0.001 - 1`. | `false`  |

***

## :warning: Error codes

Here are a few of the error codes, you will receive in responses, to help clarify issues:

#### Common error codes

<table><thead><tr><th width="177">Error code</th><th>Description</th></tr></thead><tbody><tr><td><code>400</code></td><td>Missing or invalid parameters. This is when the parameters you passed to the API, do not match the API's expected inputs.</td></tr><tr><td><code>405</code></td><td>Using an invalid method, to access the API.</td></tr><tr><td><code>429</code></td><td>The rate limit is exceeded within the current timeframe.</td></tr><tr><td><code>401</code></td><td>Invalid API key, no remaining calls (<code>No remaining API calls.</code>), or an error while processing your input.</td></tr></tbody></table>

{% hint style="info" %}
Our APIs are rigorously tested before deployments, to ensure that they do not produce any unintentional errors during production.
{% endhint %}

***

## :hourglass: Rate limiting

We use rate limiting, to protect our API's resources. Rate limiting is implemented on all of our APIs, and follows these general principles:

* `interval`: The rate limiting is set to a default interval of `1 minute`.
* `amount of requests`: The amount of requests is set to a default of `25 requests` within the given interval.

If the rate limit is exceeded, an error `429` code will be returned, instead of the actual API output.

***

## :star: Best practices

Common guidelines to use, optimize, and protect your implementation of our APIs.

* Do not store/share/expose your API keys. See [Keeping your API key safe](/documentation/api-documentation/keeping-your-api-key-safe.md)
* Implement data cleaning, and validation in your code, to ensure inputs are sanitized
* Handle API errors gracefully
* Try this endpoint in the [API playground](https://infinitode.netlify.app/api/playground) — mock mode returns dummy data in the real response shape, with no API key and no calls used
* Handle API outputs accordingly. You can see examples of this API's output in the [#endpoint](#endpoint "mention") section.
* Implement code to notify users of actions when using our APIs, such as errors, delays, formatting issues, etc.

***

## :question: FAQs

Answers to the most common questions and issues when using this API:

<details>

<summary>I am getting a <code>405</code> error, what should I do?</summary>

A `405` error means the endpoint exists, but the HTTP method doesn't: use `POST` or `GET`, since this endpoint does not accept other HTTP methods. A `404` or `NotFound` error is different — it means the route doesn't exist, usually because the endpoint URL was misspelled.

</details>

<details>

<summary>Is rate limiting set individually, or per API key?</summary>

Rate limiting is set `individually`, this means that rate limiting happens on an end-user level. This ensures that our API is used fairly, among all users.

</details>

<details>

<summary>Are request timeouts a thing?</summary>

Yes, we normally timeout requests after the 10-second mark. This, however, can vary significantly, depending on various other factors.

</details>

<details>

<summary>What is the max payload size?</summary>

The maximum payload size for `buffered executions` is `4.5mb` per request. For `streamed executions`, we use a payload restriction size of `20mb` per request.

</details>

<details>

<summary>What is the recommended way to call the API?</summary>

If you can, call the API using the `POST` method. The `GET` method works but is not recommended, especially when you're calling it by directly modifying the URL. This is because URL parameters that are strings, can sometimes be misformatted afterwards, and then incorrectly passed to the API.

</details>

<details>

<summary>Can Dungen Dev generate names for say: "A game studio name"?</summary>

Yes, since Dungen Dev is primarily aimed at creatives and developers, our training data included prompts like: "a gaming studio name", or "a brand name".

</details>

<details>

<summary>Can Dungen Dev generate NSFW content?</summary>

No, Dungen Dev was not trained on NSFW content — it has no vocabulary for it.

Unlike Dungen, Dungen Dev has no seed text to continue: your `prompt` steers the generation directly, and it has a strong influence over the result. That's exactly why the prompt is screened with our open-source [ValX](https://github.com/Infinitode/ValX) package before generation, and why inputs and outputs containing that kind of content are blocked.

That said, no filter is perfect — Dungen Dev may still generate content that is inappropriate, inaccurate, or harmful, so caution is advised. Using it for content that is illegal, violent, racist, or discriminatory is prohibited.

</details>

***

## OpenAPI

You can download the OpenAPI specification for this API to learn more about how it works and how to use it. The OpenAPI specification is a standard, language-agnostic interface to RESTful APIs that allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection.

[Download OpenAPI Specification](https://infinitode.netlify.app/openapi/dungen-dev/openapi.yaml)

***

## Conclusion

That's it! You now know the basics of using the Dungen Dev API. Don't hesitate to contact our support team with further questions or issues.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://infinitode-docs.gitbook.io/documentation/api-documentation/dungen-dev-api-documentation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
