{"openapi":"3.0.0","info":{"description":"Together AI makes it easy to run, finetune, and train open source AI models with transparency and privacy.","version":[{"name":"v1","value":"v1"}]},"servers":[{"description":"Together AI makes it easy to run, finetune, and train open source AI models with transparency and privacy.","url":"https://api.apirails.com/togetherai"}],"paths":{"/v1/chat/completions":{"post":{"tags":["Chat"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/chat-completions","api_endpoint":"https://api.together.xyz/v1/chat/completions"},"summary":"Create Chat Completion","description":"Creates a model response for the given chat conversation.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"frequency_penalty":{"type":"number","description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far."},"logprobs":{"type":"boolean","description":"Whether to return log probabilities of the output tokens or not.","enum":[true,false]},"max_tokens":{"type":"number","description":"The maximum number of tokens to generate in the completion."},"messages":{"type":"array","description":"A list of messages comprising the conversation so far.","required":true,"items":{"type":"string"}},"model":{"type":"string","description":"ID of the model to use. You can use the List Available Models API to see all of your available models.","required":true},"presence_penalty":{"type":"number","description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far."},"repetition_penalty":{"type":"number","description":"Penalty for repetition. Values > 1.0 penalize repetition, values < 1.0 encourage it."},"response_format":{"type":"object","description":"An object specifying the format that the model must output.","properties":{}},"safety_model":{"type":"string","description":"The safety model to use for content moderation."},"stop":{"type":"array","description":"Up to 4 sequences where the API will stop generating further tokens.","items":{"type":"string"}},"stream":{"type":"boolean","description":"If set, partial message deltas will be sent as data-only server-sent events as they become available.","enum":[true,false]},"temperature":{"type":"number","description":"What sampling temperature to use, between 0.0 and 2.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic."},"tool_choice":{"type":"object","description":"Controls which (if any) function is called by the model.","properties":{}},"tools":{"type":"array","description":"A list of tools the model may call. Currently, only functions are supported as a tool.","items":{"type":"string"}},"top_k":{"type":"number","description":"Limit the next token selection to the K most probable tokens."},"top_logprobs":{"type":"number","description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability."},"top_p":{"type":"number","description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass."}}},"example":{"frequency_penalty":"","logprobs":"","max_tokens":"","messages":[],"model":"","presence_penalty":"","repetition_penalty":"","response_format":{},"safety_model":"","stop":[],"stream":"","temperature":"","tool_choice":{},"tools":[],"top_k":"","top_logprobs":"","top_p":""}}}}}},"/v1/completions":{"post":{"tags":["Completions"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/completions","api_endpoint":"https://api.together.xyz/v1/completions"},"summary":"Create Completion","description":"Creates a completion for the provided prompt and parameters.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"echo":{"type":"boolean","description":"Echo back the prompt in addition to the completion.","enum":[true,false]},"frequency_penalty":{"type":"number","description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far."},"logprobs":{"type":"boolean","description":"Whether to return log probabilities of the output tokens or not.","enum":[true,false]},"max_tokens":{"type":"number","description":"The maximum number of tokens to generate in the completion."},"model":{"type":"string","description":"ID of the model to use.","required":true},"presence_penalty":{"type":"number","description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far."},"prompt":{"type":"string","description":"The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.","required":true},"repetition_penalty":{"type":"number","description":"Penalty for repetition. Values > 1.0 penalize repetition."},"safety_model":{"type":"string","description":"The safety model to use for content moderation."},"stop":{"type":"array","description":"Up to 4 sequences where the API will stop generating further tokens.","items":{"type":"string"}},"stream":{"type":"boolean","description":"If set, partial message deltas will be sent as data-only server-sent events.","enum":[true,false]},"suffix":{"type":"string","description":"The suffix that comes after a completion of inserted text."},"temperature":{"type":"number","description":"What sampling temperature to use, between 0.0 and 2.0."},"top_k":{"type":"number","description":"Limit the next token selection to the K most probable tokens."},"top_logprobs":{"type":"number","description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position."},"top_p":{"type":"number","description":"An alternative to sampling with temperature, called nucleus sampling."}}},"example":{"echo":"","frequency_penalty":"","logprobs":"","max_tokens":"","model":"","presence_penalty":"","prompt":"","repetition_penalty":"","safety_model":"","stop":[],"stream":"","suffix":"","temperature":"","top_k":"","top_logprobs":"","top_p":""}}}}}},"/v1/images/generations":{"post":{"tags":["Images"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/images","api_endpoint":"https://api.together.xyz/v1/images/generations"},"summary":"Create Image","description":"Creates an image given a prompt.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"guidance_scale":{"type":"number","description":"Guidance scale for classifier-free guidance. Higher values make the model follow the prompt more closely."},"model":{"type":"string","description":"ID of the model to use for image generation.","required":true},"n":{"type":"number","description":"The number of images to generate. Must be between 1 and 10."},"negative_prompt":{"type":"string","description":"A text description of what you want to avoid in the generated image."},"prompt":{"type":"string","description":"A text description of the desired image(s).","required":true},"response_format":{"type":"string","description":"The format in which the generated images are returned. Must be one of url or b64_json."},"seed":{"type":"number","description":"The seed to use for random sampling. If set, different calls will generate deterministic results."},"size":{"type":"string","description":"The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024."},"steps":{"type":"number","description":"The number of denoising steps. More steps generally lead to higher quality images but take longer."}}},"example":{"guidance_scale":"","model":"","n":"","negative_prompt":"","prompt":"","response_format":"","seed":"","size":"","steps":""}}}}}},"/v1/embeddings":{"post":{"tags":["Embeddings"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/embeddings","api_endpoint":"https://api.together.xyz/v1/embeddings"},"summary":"Create Embedding","description":"Creates an embedding vector representing the input text.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"input":{"type":"string","description":"Input text to embed, encoded as a string or array of strings.","required":true},"model":{"type":"string","description":"ID of the model to use for embeddings.","required":true}}},"example":{"input":"","model":""}}}}}},"/v1/models":{"get":{"tags":["Models"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/models","api_endpoint":"https://api.together.xyz/v1/models"},"summary":"List Models","description":"Lists the currently available models, and provides basic information about each one such as the owner and availability.","security":[{"bearerAuth":[]}]}},"/v1/fine-tunes":{"post":{"tags":["Fine-tuning"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/fine-tuning","api_endpoint":"https://api.together.xyz/v1/fine-tunes"},"summary":"Create Fine-tune","description":"Creates a job that fine-tunes a specified model from a given dataset.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"hyperparameters":{"type":"object","description":"The hyperparameters used for the fine-tuning job.","properties":{}},"model":{"type":"string","description":"The name of the base model to fine-tune.","required":true},"suffix":{"type":"string","description":"A string of up to 40 characters that will be added to your fine-tuned model name."},"training_file":{"type":"string","description":"The ID of an uploaded file that contains training data.","required":true},"validation_file":{"type":"string","description":"The ID of an uploaded file that contains validation data."}}},"example":{"hyperparameters":{},"model":"","suffix":"","training_file":"","validation_file":""}}}}},"get":{"tags":["Fine-tuning"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/fine-tuning","api_endpoint":"https://api.together.xyz/v1/fine-tunes"},"summary":"List Fine-tunes","description":"List your organization's fine-tuning jobs.","security":[{"bearerAuth":[]}]}},"/v1/fine-tunes/{fine_tune_id}":{"get":{"tags":["Fine-tuning"],"parameters":[{"name":"fine_tune_id","in":"path","description":"The ID of the fine-tune job to retrieve.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/fine-tuning","api_endpoint":"https://api.together.xyz/v1/fine-tunes/{fine_tune_id}"},"summary":"Retrieve Fine-tune","description":"Gets info about the fine-tune job.","security":[{"bearerAuth":[]}]}},"/v1/fine-tunes/{fine_tune_id}/cancel":{"post":{"tags":["Fine-tuning"],"parameters":[{"name":"fine_tune_id","in":"path","description":"The ID of the fine-tune job to cancel.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/fine-tuning","api_endpoint":"https://api.together.xyz/v1/fine-tunes/{fine_tune_id}/cancel"},"summary":"Cancel Fine-tune","description":"Immediately cancel a fine-tune job.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/fine-tunes/{fine_tune_id}/events":{"get":{"tags":["Fine-tuning"],"parameters":[{"name":"fine_tune_id","in":"path","description":"The ID of the fine-tune job to get events for.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/fine-tuning","api_endpoint":"https://api.together.xyz/v1/fine-tunes/{fine_tune_id}/events"},"summary":"List Fine-tune Events","description":"Get fine-grained status updates for a fine-tune job.","security":[{"bearerAuth":[]}]}},"/v1/files":{"get":{"tags":["Files"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/files","api_endpoint":"https://api.together.xyz/v1/files"},"summary":"List Files","description":"Returns a list of files that belong to the user's organization.","security":[{"bearerAuth":[]}]},"post":{"tags":["Files"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/files","api_endpoint":"https://api.together.xyz/v1/files"},"summary":"Upload File","description":"Upload a file that contains document(s) to be used across various endpoints/features.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"file":{"type":"string","description":"The file object (not file name) to be uploaded.","required":true},"purpose":{"type":"string","description":"The intended purpose of the uploaded file.","required":true}}},"example":{"file":"","purpose":""}}}}}},"/v1/files/{file_id}":{"get":{"tags":["Files"],"parameters":[{"name":"file_id","in":"path","description":"The ID of the file to use for this request.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/files","api_endpoint":"https://api.together.xyz/v1/files/{file_id}"},"summary":"Retrieve File","description":"Returns information about a specific file.","security":[{"bearerAuth":[]}]},"delete":{"tags":["Files"],"parameters":[{"name":"file_id","in":"path","description":"The ID of the file to use for this request.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/files","api_endpoint":"https://api.together.xyz/v1/files/{file_id}"},"summary":"Delete File","description":"Delete a file.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/files/{file_id}/content":{"get":{"tags":["Files"],"parameters":[{"name":"file_id","in":"path","description":"The ID of the file to use for this request.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/files","api_endpoint":"https://api.together.xyz/v1/files/{file_id}/content"},"summary":"Retrieve File Content","description":"Returns the contents of the specified file.","security":[{"bearerAuth":[]}]}},"/v1/batches":{"post":{"tags":["Batch"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/batch-inference","api_endpoint":"https://api.together.xyz/v1/batches"},"summary":"Create Batch","description":"Creates and executes a batch from an uploaded file of requests.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"endpoint":{"type":"string","description":"The endpoint to use for the batch. One of /v1/chat/completions, /v1/completions, /v1/embeddings.","required":true},"input_file_id":{"type":"string","description":"The ID of an uploaded file that contains requests for the new batch.","required":true},"job_deadline":{"type":"string","description":"The deadline for the batch job. If the job is not completed by this time, it will be cancelled."},"model_id":{"type":"string","description":"The model to use for the batch.","required":true}}},"example":{"endpoint":"","input_file_id":"","job_deadline":"","model_id":""}}}}},"get":{"tags":["Batch"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/batch-inference","api_endpoint":"https://api.together.xyz/v1/batches"},"summary":"List Batches","description":"List your organization's batches.","security":[{"bearerAuth":[]}]}},"/v1/batches/{batch_id}":{"get":{"tags":["Batch"],"parameters":[{"name":"batch_id","in":"path","description":"The ID of the batch to retrieve.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/batch-inference","api_endpoint":"https://api.together.xyz/v1/batches/{batch_id}"},"summary":"Retrieve Batch","description":"Retrieves a batch.","security":[{"bearerAuth":[]}]}},"/v1/batches/{batch_id}/cancel":{"post":{"tags":["Batch"],"parameters":[{"name":"batch_id","in":"path","description":"The ID of the batch to cancel.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/batch-inference","api_endpoint":"https://api.together.xyz/v1/batches/{batch_id}/cancel"},"summary":"Cancel Batch","description":"Cancels an in-progress batch.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/v1/endpoints":{"post":{"tags":["Endpoints"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/createendpoint","api_endpoint":"https://api.together.xyz/v1/endpoints"},"summary":"Create Dedicated Endpoint","description":"Creates a new dedicated endpoint.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"autoscaling":{"type":"object","description":"Autoscaling configuration for the endpoint.","properties":{}},"disable_prompt_cache":{"type":"boolean","description":"Whether to disable prompt caching.","enum":[true,false]},"disable_speculative_decoding":{"type":"boolean","description":"Whether to disable speculative decoding.","enum":[true,false]},"display_name":{"type":"string","description":"A human-readable name for the endpoint."},"hardware":{"type":"string","description":"The hardware configuration for the endpoint.","required":true},"inactive_timeout":{"type":"number","description":"The timeout in seconds before the endpoint is automatically stopped when inactive."},"model":{"type":"string","description":"The model to deploy on the endpoint.","required":true},"state":{"type":"string","description":"The initial state of the endpoint."}}},"example":{"autoscaling":{},"disable_prompt_cache":"","disable_speculative_decoding":"","display_name":"","hardware":"","inactive_timeout":"","model":"","state":""}}}}},"get":{"tags":["Endpoints"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/listendpoints","api_endpoint":"https://api.together.xyz/v1/endpoints"},"summary":"List Dedicated Endpoints","description":"Lists all dedicated endpoints for your organization.","security":[{"bearerAuth":[]}]}},"/v1/endpoints/{endpoint_id}":{"get":{"tags":["Endpoints"],"parameters":[{"name":"endpoint_id","in":"path","description":"The ID of the endpoint to retrieve.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/getendpoint","api_endpoint":"https://api.together.xyz/v1/endpoints/{endpoint_id}"},"summary":"Retrieve Dedicated Endpoint","description":"Retrieves a dedicated endpoint.","security":[{"bearerAuth":[]}]},"patch":{"tags":["Endpoints"],"parameters":[{"name":"endpoint_id","in":"path","description":"The ID of the endpoint to update.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/updateendpoint","api_endpoint":"https://api.together.xyz/v1/endpoints/{endpoint_id}"},"summary":"Update Dedicated Endpoint","description":"Updates a dedicated endpoint. Can be used to start, stop, or pause an endpoint.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"autoscaling":{"type":"object","description":"Autoscaling configuration for the endpoint.","properties":{}},"display_name":{"type":"string","description":"A human-readable name for the endpoint."},"inactive_timeout":{"type":"number","description":"The timeout in seconds before the endpoint is automatically stopped when inactive."},"state":{"type":"string","description":"The new state of the endpoint. Can be 'running', 'stopped', or 'paused'."}}},"example":{"autoscaling":{},"display_name":"","inactive_timeout":"","state":""}}}}},"delete":{"tags":["Endpoints"],"parameters":[{"name":"endpoint_id","in":"path","description":"The ID of the endpoint to delete.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.together.ai/reference/deleteendpoint","api_endpoint":"https://api.together.xyz/v1/endpoints/{endpoint_id}"},"summary":"Delete Dedicated Endpoint","description":"Deletes a dedicated endpoint.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"security":[{"bearerAuth":[]}]}