> ## Documentation Index
> Fetch the complete documentation index at: https://docs.synapsai.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Fill Mask

> Examples of fill mask inference with SynapsAI Cloud

Our fill mask endpoint predicts masked tokens in text sequences, similar to BERT-style masked language modeling.

Here is an example of fill mask:

**Parameters:**

* `model`: The model ID of the model you want to use
* `inputs`: The text sequence(s) with masked tokens (typically using `<mask>` tokens)
* `targets`: Specific target tokens to consider (optional)
* `top_k`: The number of top predictions to return (default: 5)

<CodeGroup>
  ```python title="Python" theme={null}
  from synapsai import SynapsAI

  model = SynapsAI("your-api-key")

  response = model.fill_mask.create(
      model="model-id",
      inputs="The quick brown <mask> jumps over the lazy dog.",
      targets=None,
      top_k=5
  )

  for result in response.data:
      print("Masks:", result.masks)
      print("Score:", result.score)
  ```

  ```curl title="cURL" theme={null}
  curl -X POST https://api.synapsai.cloud/v1/fill-mask \
    -H "Authorization: Bearer $SYNAPSAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
          "model": "model-id",
          "inputs": "The quick brown <mask> jumps over the lazy dog.",
          "targets": null,
          "top_k": 5
      }'
  ```
</CodeGroup>

Here is an example with multiple inputs and specific targets:

<CodeGroup>
  ```python title="Python" theme={null}
  from synapsai import SynapsAI

  model = SynapsAI("your-api-key")

  response = model.fill_mask.create(
      model="model-id",
      inputs=[
          "The capital of France is <mask>.",
          "Machine learning is a subset of <mask>."
      ],
      targets=["Paris", "artificial intelligence", "AI", "computer science"],
      top_k=3
  )

  for result in response.data:
      print("Masks:", result.masks)
      print("Score:", result.score)
      print("---")
  ```

  ```curl title="cURL" theme={null}
  curl -X POST https://api.synapsai.cloud/v1/fill-mask \
    -H "Authorization: Bearer $SYNAPSAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
          "model": "model-id",
          "inputs": [
            "The capital of France is <mask>.",
            "Machine learning is a subset of <mask>."
          ],
          "targets": ["Paris", "artificial intelligence", "AI", "computer science"],
          "top_k": 3
      }'
  ```
</CodeGroup>

For deeper insights into the fill mask endpoint, see our [API reference](https://docs.synapsai.cloud/api-reference/fill-mask-predictions).
