API Documentation
Welcome to the NavyAI API documentation. Our API provides access to state-of-the-art AI models for chat, embeddings, image generation, audio processing, and more. All endpoints follow OpenAI's API structure for easy integration.
https://api.navy/v1 and you're ready to go.
Authentication
All API requests require authentication using an API key. Include your API key in the Authorization header.
Authorization: Bearer YOUR_API_KEY
Chat Completions
Create chat completions using advanced language models. Supports streaming, multi-turn conversations, and various parameters for controlling output.
Code Examples
Parameters
| Parameter | Type | Description |
|---|---|---|
| modelrequired | string | Model ID to use (e.g., gpt-5, o4-mini, claude-sonnet-4.5) |
| messagesrequired | array | List of message objects with role (system/user/assistant) and content |
| max_tokensoptional | integer | Maximum tokens to generate in completion |
| temperatureoptional | number | Sampling temperature (0.0-2.0). Lower values = more deterministic |
| top_poptional | number | Nucleus sampling threshold (0.0-1.0) |
| streamoptional | boolean | Enable streaming responses via server-sent events |
Embeddings
Generate text embeddings for semantic search, clustering, and similarity comparisons.
Code Examples
Parameters
| Parameter | Type | Description |
|---|---|---|
| modelrequired | string | Embedding model ID (e.g., text-embedding-ada-002) |
| inputrequired | string | array | Text or array of texts to embed |
| encoding_formatoptional | string | Return format: "float" (default) or "base64" |
Image Generation
Generate images from text descriptions using state-of-the-art diffusion models.
This endpoint is also used for video models - the only difference is that the output URL points to a
video file instead of an image.
Code Examples
Parameters
| Parameter | Type | Description |
|---|---|---|
| modelrequired | string | Image model ID (e.g., flux.1-schnell, dall-e-3) |
| promptrequired | string | Text description of the desired image |
| sizeoptional | string | Image resolution (e.g., "1024x1024", "512x512") |
| qualityoptional | string | For DALL·E 3: "standard" or "hd" |
| styleoptional | string | DALL·E 3 style: "vivid" or "natural" |
Text-to-Speech
Convert text to natural-sounding speech audio with multiple voice options.
Code Examples
Parameters
| Parameter | Type | Description |
|---|---|---|
| modelrequired | string | TTS model ID (e.g., tts-1, tts-1-hd) |
| inputrequired | string | Text to convert to speech |
| voicerequired | string | Voice preset: alloy, echo, fable, onyx, nova, shimmer |
| speedoptional | number | Playback speed (0.25 to 4.0, default: 1.0) |
| response_formatoptional | string | Audio format: mp3, opus, aac, flac (default: mp3) |
Speech-to-Text
Transcribe audio files into text with high accuracy across multiple languages.
Code Examples
Parameters
| Parameter | Type | Description |
|---|---|---|
| modelrequired | string | Transcription model (e.g., whisper-1) |
| filerequired | file | Audio file to transcribe (max 25MB): mp3, mp4, mpeg, mpga, wav, webm |
| languageoptional | string | Input language in ISO-639-1 format (e.g., "en", "de") |
| response_formatoptional | string | Output format: json, text, srt, verbose_json, vtt |
Moderations
Check text content for policy violations and harmful content.
Code Examples
Parameters
| Parameter | Type | Description |
|---|---|---|
| modeloptional | string | Moderation model: text-moderation-stable or text-moderation-latest |
| inputrequired | string | array | Text to check for content policy violations |
Create Response
Generate model responses with flexible input options and metadata support.
Code Examples
Parameters
| Parameter | Type | Description |
|---|---|---|
| modelrequired | string | Model ID to use for response generation |
| inputrequired | string | object | Text, image, or file inputs for the model |
| streamoptional | boolean | Stream response as server-sent events |
| instructionsoptional | string | System message for model context |
| max_output_tokensoptional | integer | Maximum tokens to generate |
| metadataoptional | object | Key-value pairs for storing additional information |
List Models
Retrieve a list of all available models and their details.
Code Examples
Usage Statistics
Get detailed usage statistics for your API key including request counts and token usage.
Code Examples